• 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!

Lua onKill Storage [OTX]

Wanheda

New Member
Joined
Feb 17, 2016
Messages
44
Solutions
2
Reaction score
4
Needed a script where each creature the player kills he adds x storage, and when he kills x amount he will be teleported.

I tried to create something, but I couldn't, can someone help me?

Lua:
local kill = CreatureEvent("KillCreature")
function kill.onKill(player, target)
    if target:isPlayer() or target:getMaster() then
        return true
    end

    if(isMonster(target)) then
        local killAmount = player:getStorageValue(598626)
        if(string.lower(getCreatureName(target)) == "rat") and killAmount < 4 then
            player:setStorageValue(598626, killAmount + 1)   
        else
            player:teleportTo(32371, 32233, 7)
        end
    end
    return true
end

kill:register()
 
Back
Top