adrian alvarez
Member
- Joined
- Mar 7, 2017
- Messages
- 46
- Solutions
- 1
- Reaction score
- 6
ok i have one script, The function is that when you click it, it creates a monster, it works very well but I want to put it in every 1 hour, is it possible? this is the script
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local fromPos = {x = toPosition.x - 10, y = toPosition.y - 10, z = toPosition.z}
local toPos = {x = toPosition.x + 10, y = toPosition.y + 10, z = toPosition.z}
local amount = 0
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local monster = getTopCreature({x=x,y=y,z=z}).uid
if(isCreature(monster) == TRUE) then
if getCreatureName(monster) == "Melting Frozen Horror" then
amount = amount+1
end
end
end
end
end
if amount >= 1 then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You need to kill Melting Frozen Horror first before you can summen one again.")
return true
else
doSummonCreature("Melting Frozen Horror", {x = toPosition.x - 1, y = toPosition.y + 1, z = toPosition.z})
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have summened Melting Frozen Horror.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
return true
end