FireGuns

Fire guns at target

Usage: Used in 9 task(s)

Lua Implementation

-- Fire Guns
function execute(params)
    local target = params.target
    local gunSystem = this:getSystem("Gun")

    if gunSystem and target and target:isValid() then
        gunSystem:setAttribute("Target", target)
        gunSystem:setAttribute("Fire", true)
        this:addTask("DtFire", {
            target = target,
            weapon = "gun",
            duration = params.duration or 2.0
        })
        return true
    end
    return false
end