No categories assigned

LUA:SetFollowTarget

Revision as of 21:01, 23 May 2013 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: SetFollowTarget() = Sets the spawns follow target ==== Syntax ==== SetFollowTarget(param1, param2) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''par...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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()