<script>
<event name="killBoss" />
</script>
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()
<script>
<event name="killBoss" />
</script>
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 bestXML:<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?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()
Was literally just finishing typing this. lolHey 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
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 meWas 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?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()
That's mostly on how you check for the storage..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?
player:setStorageValue(config.timeStorage, config.timeDelay + os.time()) -- sets it to a huge number
player:setStorageValue(config.timeStorage, 1) -- sets it to 1
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?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()
<script>
<event name="dragon" />
</script>
Sorry for slow reply.No, where is it added?
data/monster/monsters/dragon.xml
use the script from post #5 not #8Help
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()