No categories assigned

LUA:Knockback

Revision as of 14:36, 4 December 2013 by Jabantiz (talk | contribs)

LUA Functions: Knockback()

Plays the knockback animation and can push a player back

Syntax

Knockback(param1, param2, param3, [param4], [param5], [param6])


Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (int32)
param1 is the spawn performing the knockback
param2 is the spawn being knocked back
param3 is the animation duration in milliseconds
Optional - param4 (float), param5 (float), param6 (int8)
param4 is the vertical movement
param4 is the horizontal movement
param5 is use player heading

Usage

function hailed(NPC, Spawn)
    Knockback(NPC, Spawn, 4000)
end

When the NPC is hailed it will knockback the spawn that hailed it

Notes

To get the knocked on back set param3 to at least 4000 (4 seconds), any thing lower will play the knocked to knees animation