Lua GetClosestFriend

From ArcEmu-Wiki
Jump to: navigation, search
+/-
Main Page        LuaArcEmu Website     ArcEmu Forum     Bug Tracker



Syntax

pFriend = pUnit:GetClosestFriend()


Description

Will get the closest unit that is considered 'friendly'.


Example

function OnEnterWorld(event, pPlayer)
  if( pPlayer:GetClosestFriend() ~=nil ) then
    -- Do stuff here if there is a friend
  else
    -- Do stuff here if no friend
  end
end
RegisterServerHook(4, "OnEnterWorld")
Personal tools