No categories assigned

LUA:SetLocationProximityFunction

Revision as of 19:09, 9 May 2013 by Thefoof (talk | contribs)

This function sets a location to check when spawns enter a certain range of the location. It calls different functions when that spawn either moves in range or out of range. The out of range parameter is optional.

Syntax

SetLocationProximityFunction(Zone, X, Y, Z, Radius, "InRange", ["OutRange"])

Usage

function init_zone_script(Zone)
    SetLocationProximityFunction(Zone, -316.244, 35.409, -714.906, 10, "InRange", "OutRange")
end

When a zone script is started init_zone_script is called, which then sets a location of -316.244, 35.409, -714.409. When a spawn moves within 10 meters of that location InRange will be called, when a spawn moves out of range OutRange will be called.


Back to LUA General Functions Index