• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

onTargetCombat wont work script

jededias

Member
Joined
Jan 21, 2019
Messages
66
Solutions
1
Reaction score
12
I put this code in events/scripts/creature.lua and it wont work and don't show errors in distro

Lua:
local attackOutfit = Condition(CONDITION_OUTFIT, CONDITIONID_COMBAT)



local outfitTable = {

    --Looktype/newLooktype/Seconds until newOutfit removes

    [100] = {newOutfit = 101, outfitInterval = 3}

}



function Creature:onTargetCombat(target)

    if self:isPlayer() then

        local table = outfitTable[self:getOutfit().lookType]

        if table then

            attackOutfit:setOutfit({lookType = table.newOutfit})

            attackOutfit:setTicks(table.outfitInterval * 1000)

            self:addCondition(attackOutfit)

        end

    end

    return true

end
 
Back
Top