dimanche 22 juillet 2018

How to make a delay in if statement

I want to make the function avatar.StopCasting() to be executed after 1.5 seconds?

local function main(avatarId)

if className ~= avatar.GetClass() then

    return

end

local eventActionProgressStart = {

    name = 'EVENT_ACTION_PROGRESS_START',
    handler = function(event)

        if not object.IsInCombat(avatarId) then

            **avatar.StopCasting()**

        end

    end,
    params = {name = userMods.ToWString(spellName)}
}

aspectd:init(avatarId, aspectName, function(state)

    toggleEvent(eventActionProgressStart, state)

end)

end

Aucun commentaire:

Enregistrer un commentaire