You are viewing an old version of this page. Return to the latest version.
Version of 18:48, 9 May 2013 by I need to Update My Profile
No categories assigned
LUA:SetPlayerProximityFunction
- Last edited 12 years ago by I need to Update My Profile
This sets a range around a spawn to detect when a player is within the set range, and when they leave the range, calling functions each time. The out of range parameter is optional.
Syntax
SetPlayerProximityFunction(target, range, "In range function", ["out of range function"])
Usage
function spawn(NPC) SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange") end
When a player enters within 10 meters of a spawn with this function in their script, a function name InRange will be called, and when they leave LeaveRange will be called.