No categories assigned

LUA:CastEntityCommand

Revision as of 21:42, 12 May 2013 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: CastEntityCommand() = Casts an entity command on the target ==== Syntax ==== CastEntityCommand(param1, param2, param3) ==== Parameters ==== ; Required - ''pa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: CastEntityCommand()

Casts an entity command on the target


Syntax

CastEntityCommand(param1, param2, param3)


Parameters

Required - param1 (Spawn), param2 (Spawn), param3 (String)
param1 is the caster of the entity command, must be a player
param2 is the target of the entity command
param3 is the entity command


Usage

function used(Item, Spawn)
    target = GetTarget(Spawn)
    if target ~= nil then
        CastEntityCommand(Spawn, target, "Test entity command")
    end
end

This item script will cast the "Test entity command" entity command on the players target when the item is used