I want to make a lua script that basicly announces to on the server, when a player kills a custom boss. It would look like "-[Player]- has Just Killed -{Custom Boss}-". How do I make this script? or can someone make it for me?
I want to make a lua script that basicly announces to on the server, when a player kills a custom boss. It would look like "-[Player]- has Just Killed -{Custom Boss}-". How do I make this script? or can someone make it for me?
Are you using LuaHypArc?
PS: I don't know lua for shizznit. But I found the commands here.
Hope it helps. I tried to figure out a script for you, but lua is NOT my profession.
Last edited by I Hypnotoad I; 06-05-2010 at 12:18 AM.
Dragon[Sky] can get into our signatures, AND our pants.
Enjoy. Also here is a list of commands added with LuaHypArc (it comes with default ArcEmu): http://arcemu.info/trac/arcscripts/b...E_COMMANDS.txtCode:function X_OnDeath(pUnit, Event) local plr = pUnit:GetClosestPlayer() if plr ~= nil then local name = plr:GetName() local world = GetPlayersInWorld() -- I don't know if this needs pUnit in front of it. for a, plrs in pairs(world) do plrs:SendBroadcastMessage("This awesome boss of epix was just killed by "..name.."!") plrs:SendAreaTriggerMessage("This awesome boss of epix was just killed by "..name.."!") end end end RegisterUnitEvent(npcid, 4, "X_OnDeath")
Very nice, thanks stoneharry.
Thanks stoneharry, but this is what I ended up writing
Code:function Altor_OnDied(Unit, Event) Unit:SendChatMessage(14, 0, "I have failed. May the creator smite your wretched souls.") Unit:RemoveEvents() for k,v in pairs(GetPlayersInWorld()) do v:SendBroadcastMessage("" ..Player:GetName().."[" ..Player:Getlevel().. "] has slain " ..Unit:GetName().."!") end end
You didn't define the player, but good cut-down on the variable use.