Difference between revisions of "LUA:SpawnSet"

(Created page with "= LUA Functions: SpawnSet() = Works like /spawn set in game ==== Syntax ==== SpawnSet(param1, param2, param3, param4) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
= LUA Functions: SpawnSet() =
+
{{LUAFunction
Works like /spawn set in game
+
|Name = SpawnSet
 
+
|Description = Sets various settings for a NPC or Object
 
+
|Param1 = Spawn
==== Syntax ====
+
|Param1Desc = must be a reference to a NPC or Object.
SpawnSet(param1, param2, param3, param4)
+
|Param2 = string
 
+
|Param2Desc = is what we want to change. ''eg name''
 
+
|Param3 = string
==== Parameters ====
+
|OptionalParam1Desc = is what we want to change the param2 to
; Required - ''param1'' (Spawn), ''param2'' (string), ''param3'' (string)
+
|Example =
: ''param1'' is the spawn we are performing the spawn set on
 
: ''param2'' is the variable we are changing
 
: ''param3'' is what we are setting the variable to
 
 
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
     SpawnSet(NPC, "name", "New Name")
+
     SpawnSet(NPC, "name", "Frankenstein")
 
end
 
end
 
</pre>
 
</pre>
 +
|ExampleDesc = When this NPC is hailed it will change its name to "Frankenstein"
 +
|Notes = /spawn set location does not require a vaule, the client's current location is used instead.
  
When this NPC is hailed it will change its name to "New Name"
+
[[Commands:spawn_set|List]] of spawn set param2 variables you can change
 +
}}

Latest revision as of 14:29, 30 January 2021


LUA:AllFunctions - SpawnSet

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


Sets various settings for a NPC or Object

Syntax

SpawnSet(param1, param2, param3)

Parameters

Required - param1 (Spawn), param2 (string), param3 (string)
param1 must be a reference to a NPC or Object.
param2 is what we want to change. eg name
param3 Description not provided in the template...


Example

function hailed(NPC, Spawn)
    SpawnSet(NPC, "name", "Frankenstein")
end

When this NPC is hailed it will change its name to "Frankenstein"

Notes

/spawn set location does not require a vaule, the client's current location is used instead.

List of spawn set param2 variables you can change