|Main Page LuaArcEmu Website ArcEmu Forum Bug Tracker|
pPlayer = pUnit:GetClosestPlayer()
Used when you want the unit to target the closest player in range. Target must be a player and is a unit-only command. It is recommended to add nil checks after registering this command.
function OnEnterWorld(event, pPlayer) if(pPlayer:GetClosestPlayer() ~=nil ) then -- Do stuff here if another player was found end end RegisterServerHook(4, "OnEnterWorld")