No categories assigned

LUA:SpawnSetByDistance

LUA Functions: SpawnSetByDistance()

Does a spawn set on all spawns within the given distance of the given spawn


Syntax

SpawnSetByDistance(param1, param2, param3, param4)


Parameters

Required - param1 (Spawn), param2 (float), param3 (string), param4 (string)
param1 is the spawn to use as a center point
param2 is the distance around the spawn to apply the command to
param3 is the variable
param4 is the value to set the variable to


Usage

function hailed(NPC, Spawn)
    SpawnSetByDistance(Spawn, 25.5, "visual_state", 1234)
end

When this NPC is hailed all spawns within 25.5 units from the player will have its visual state set to 1234