president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi folks, I was trying to make something here but it isn't working, does not have any kind of errors, just don't work.
The idea of this script is if you kill a Ghazbaran for like three times then you'll get a achievement and a storage.
I think this script is fucked up. Don't know, XD!
Thanks everyone.
The idea of this script is if you kill a Ghazbaran for like three times then you'll get a achievement and a storage.
I think this script is fucked up. Don't know, XD!
Code:
local function summonMonster(name, position)
Game.createMonster(name, position)
position:sendMagicEffect(CONST_ME_TELEPORT)
end
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
if targetMonster:getName():lower() ~= 'ghazbaran' then
return true
end
local player = creature:getPlayer()
local storage = player:getStorageValue(Storage.bossSlayer)
if storage >= 0 and storage < 3 then
player:setStorageValue(Storage.bossSlayer, math.max(1, storage) + 1)
player:addAchievement('Boss Slayer')
end
target:say("A demon will be summoned in two minutes", TALKTYPE_MONSTER_SAY, false, player, Position(2454, 2657, 9))
addEvent(summonMonster, 2 * 60 * 1000, 'Demon', Position(2454, 2657, 9))
return true
end
Thanks everyone.