Difference between revisions of "LUA:Attack"

(Created page with "= LUA Functions: Attack() = Forces a NPC to attack a player. ==== Syntax ==== Attack(param1, param2) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''param2'' (Spawn) ...")
 
 
Line 1: Line 1:
= LUA Functions: Attack() =
+
{{LUAFunction
Forces a NPC to attack a player.
+
|Name = Attack
 
+
|Description = Forces a NPC to attack a player.
 
+
|Param1 = Spawn
==== Syntax ====
+
|Param1Desc = is the spawn that will attack the target, must be an NPC
Attack(param1, param2)
+
|Param2 = Spawn
 
+
|Param2Desc = is the target, must be a player
 
+
|Example =
==== Parameters ====
 
; Required - ''param1'' (Spawn), ''param2'' (Spawn)
 
: ''param1'' is the spawn that will attack the target, must be an NPC
 
: ''param2'' is the target, must be a player
 
 
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
Line 19: Line 12:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = The NPC will attack the player that hails it.
The NPC will attack the player that hails it.
+
|Notes = None
 +
}}

Latest revision as of 12:07, 30 January 2021


LUA:AllFunctions - Attack

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


Forces a NPC to attack a player.

Syntax

Attack(param1, param2)

Parameters

Required - param1 (Spawn), param2 (Spawn)
param1 is the spawn that will attack the target, must be an NPC
param2 is the target, must be a player


Example

function hailed(NPC, Spawn)
    Attack(NPC, Spawn)
end

The NPC will attack the player that hails it.

Notes

None