Lua GetEntry

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


Syntax

entry = pUnit:GetEntry()

Description

Returns the entry ID of the unit. Works for NPC as well as for GO


Example

function CheckUnits(pUnit)
	for k, pFriend in pairs(pUnit:GetInRangeFriends()) do
		if(pFriend:GetEntry()==101) and (pFriend ~= nil) then
			pFriend:SendChatMessage(12, 0, "You found me!")
		end
	end
end

Checks to see if any unit with the entry 101 is nearby, if there is the unit will say "You found me!".

Personal tools