Difference between revisions of "LUA:HasGroup"
(Created page with "= LUA Functions: AddHate() = Adds hate to ''param2'' from ''param1'' ==== Syntax ==== AddHate(param1, param2, param3) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''...") |
|||
| Line 1: | Line 1: | ||
| − | = LUA Functions: | + | = LUA Functions: HasGroup() = |
| − | + | Checks to see if the given spawn has a group | |
| − | |||
==== Syntax ==== | ==== Syntax ==== | ||
| − | + | HasGroup(param1) | |
==== Parameters ==== | ==== Parameters ==== | ||
| − | ; Required - ''param1'' (Spawn | + | ; Required - ''param1'' (Spawn) |
| − | : ''param1'' is the spawn | + | : ''param1'' is the spawn we want to check |
| − | |||
| − | |||
==== Usage ==== | ==== Usage ==== | ||
<pre> | <pre> | ||
| − | function | + | function hailed(NPC, Spawn) |
| − | + | if HasGroup(NPC) then | |
| − | + | Say(NPC, "I have friends!") | |
| + | else | ||
| + | Say(NPC, "I am a loner!") | ||
| + | end | ||
end | end | ||
</pre> | </pre> | ||
| − | This | + | This will cause the spawn to say if they are in a group or not when hailed |
== Notes == | == Notes == | ||
| − | + | This will work on both NPC's and player's | |
Latest revision as of 21:31, 28 August 2013
LUA Functions: HasGroup()
Checks to see if the given spawn has a group
Syntax
HasGroup(param1)
Parameters
- Required - param1 (Spawn)
- param1 is the spawn we want to check
Usage
function hailed(NPC, Spawn)
if HasGroup(NPC) then
Say(NPC, "I have friends!")
else
Say(NPC, "I am a loner!")
end
end
This will cause the spawn to say if they are in a group or not when hailed
Notes
This will work on both NPC's and player's