No categories assigned
LUA:GetSpawn
- Last edited 12 years ago by I need to Update My Profile
LUA Functions: GetSpawn()
Gets a spawn by the given spawn id.
Syntax
var = GetSpawn(param1, param2)
Parameters
- Required - param1 (Spawn), param2 (int32)
- param1 is a known spawn in the same zone, usually the player
- param2 is DB id of the spawn you want
Usage
function hailed(NPC, Spawn)
local spawn2 = GetSpawn(Spawn, 1234)
local distance = GetDistance(Spawn, Spawn2)
Say(NPC, "Distance to spawn: " .. distance)
end
The NPC will respond with the distance to the closest spawn to the player with an id of 1234
Notes
Returns a spawn
Gets the closest spawn to the spawn given as the first param