Difference between revisions of "LUA:IsPet"
(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: IsPet() = |
| − | + | Checks to see if the given spawn is a pet | |
==== Syntax ==== | ==== Syntax ==== | ||
| − | + | IsPet(param1) | |
==== Parameters ==== | ==== Parameters ==== | ||
| − | ; Required - ''param1'' (Spawn | + | ; Required - ''param1'' (Spawn) |
| − | : ''param1'' is the spawn that | + | : ''param1'' is the spawn that we want to check |
| − | |||
| − | |||
==== Usage ==== | ==== Usage ==== | ||
<pre> | <pre> | ||
| − | function | + | function hailed(NPC, Spawn) |
| − | + | if IsPet(NPC) then | |
| − | + | Say(NPC, "I am a pet!") | |
| + | else | ||
| + | Say(NPC, "I am not a pet!") | ||
| + | end | ||
end | end | ||
</pre> | </pre> | ||
| − | This is a | + | This will cause the NPC to say if it is a pet or not |
| − | == Notes == | + | ==== Notes ==== |
| − | + | This function returns a bool. true if it is a pet | |
Latest revision as of 17:07, 28 August 2013
LUA Functions: IsPet()
Checks to see if the given spawn is a pet
Syntax
IsPet(param1)
Parameters
- Required - param1 (Spawn)
- param1 is the spawn that we want to check
Usage
function hailed(NPC, Spawn)
if IsPet(NPC) then
Say(NPC, "I am a pet!")
else
Say(NPC, "I am not a pet!")
end
end
This will cause the NPC to say if it is a pet or not
Notes
This function returns a bool. true if it is a pet