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

RevScripts Kill add Storage

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Good afternoon, someone helps me with a scripts of killing a monster you of a storage for 24 hours
 
Solution
XML:
<script>
    <event name="killBoss" />
</script>

Lua:
local config = {
    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end

    killer:setStorageValue(config.timeStorage, config.timeDelay + os.time())
    return true
end

cEvent:register()
XML:
<script>
    <event name="killBoss" />
</script>

Lua:
local config = {
    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end

    killer:setStorageValue(config.timeStorage, config.timeDelay + os.time())
    return true
end

cEvent:register()
 
Solution
XML:
<script>
    <event name="killBoss" />
</script>

Lua:
local config = {
    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end

    killer:setStorageValue(config.timeStorage, config.timeDelay + os.time())
    return true
end

cEvent:register()
thanks bro, you are the best
 
XML:
<script>
    <event name="killBoss" />
</script>

Lua:
local config = {
    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end

    killer:setStorageValue(config.timeStorage, config.timeDelay + os.time())
    return true
end

cEvent:register()
Hey bro, I want the storage to give it to everyone who killed him, can you help me?
Post automatically merged:

@Xikini can you help me with this? It only gives storage to the one who inflicts more damage or gives the last hit
 
Last edited:
Hey bro, I want the storage to give it to everyone who killed him, can you help me?
Post automatically merged:

@Xikini can you help me with this? It only gives storage to the one who inflicts more damage or gives the last hit
Was literally just finishing typing this. lol

Lua:
local config = {    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
 
Was literally just finishing typing this. lol

Lua:
local config = {    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
hahahaha thank you very much bro, yes it worked for me
Post automatically merged:

Was literally just finishing typing this. lol

Lua:
local config = {    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
bro I'm sorry for continuing to bother you but, how do I make it have the storage forever?
 
Last edited:
hahahaha thank you very much bro, yes it worked for me
Post automatically merged:


bro I'm sorry for continuing to bother you but, how do I make it have the storage forever?
That's mostly on how you check for the storage..
In both cases below, the storage is given forever.
Lua:
player:setStorageValue(config.timeStorage, config.timeDelay + os.time()) -- sets it to a huge number
player:setStorageValue(config.timeStorage, 1) -- sets it to 1
 
it does not give me the storage

Lua:
local config = {   
    timeStorage = 9506,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("dragon")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
 
it does not give me the storage

Lua:
local config = { 
    timeStorage = 9506,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("dragon")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
Have you registered the creatureEvent inside the monster?
XML:
<script>
    <event name="dragon" />
</script>
 
Ready thanks for those who did not know like me, I leave this.

monster.events = {"killboss"}

@xiniki you are big
 
Last edited:
that I'm using

Lua:
local config = {    timeStorage = 99999,
    timeDelay   = 24 * 60 * 60 -- 24h
}

local cEvent = CreatureEvent("killBoss")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, config.timeDelay + os.time())
        end
    end
    return true
end

cEvent:register()
 
Back
Top