Difference between revisions of "LUA:SetFollowTarget"

(Created page with "= LUA Functions: SetFollowTarget() = Sets the spawns follow target ==== Syntax ==== SetFollowTarget(param1, param2) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''par...")
 
(No difference)

Latest revision as of 21:01, 23 May 2013

LUA Functions: SetFollowTarget()

Sets the spawns follow target

Syntax

SetFollowTarget(param1, param2)


Parameters

Required - param1 (Spawn), param2 (Spawn)
param1 is the spawn that will be following the other
param2 is the spawn that the first is following

Usage

function hailed(NPC, Player)
    SetFollowTarget(NPC, Player)
    if not IsFollowing(NPC) then
        ToggleFollow(NPC)
    end
end

This spawn script will have the spawn follow the last player to hail it.

Notes

Setting a follow target will not make the spawn follow it, for the spawn to start following you need to call ToggleFollow()