No categories assigned

LUA:SetFactionID

Revision as of 17:43, 15 June 2022 by Cynnar (talk | contribs) (Created page with "{{LUAFunction |Name = SetFactionID |Description = Sets the faction of a spawn to a faction id |Param1 = Spawn |Param1Desc = is the spawn to change the faction of |Param2 = int...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


LUA:AllFunctions - SetFactionID

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Sets the faction of a spawn to a faction id

Syntax

SetFactionID(param1, param2)

Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn to change the faction of
param2 is the id of the faction we want to use


Example

function hailed(NPC, Player)
	SetFactionID(NPC, 1)
end

An NPC with this script will set it's faction to 1 when hailed.