• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

summon monster with delay

Gsp

RP
Joined
Jan 3, 2008
Messages
250
Solutions
1
Reaction score
5
hello guys
this is my movement script
it summons monsters on stepin

Code:
 wl1 = {x=212, y=225, z=10}
 wl2 = {x=208, y=224, z=10}

function onStepIn(cid, item, frompos, item2, topos)
     if getPlayerStorageValue(cid,15321) == -1 then

doSummonCreature("Warlock", wl1)
doSummonCreature("Warlock", wl2)
		setPlayerStorageValue(cid,15321,1)
end
return 1
end

how do i make it so it will summon 2 more warlocks after 30 seconds? im still learning .i think addEvent is used for this. i tried but its beyond my knowladge. hope someone helps so i can learn addevent function and have a nice quest script for my server
thanks
 
Code:
function onStepIn(cid, item, frompos, item2, topos)
 local time =
{
   sec = 30
}
	if getPlayerStorageValue(cid, 15321) == -1 then
	   doSummonCreature("Warlock", {x=212, y=225, z=10})
	   addEvent(funcSummonWarlock, time.sec * 1000)
	   setPlayerStorageValue(cid, 15321, 1)
 end
 return TRUE
end

function funcSummonWarlock()
	   doSummonCreature("Warlock", {x=208, y=224, z=10})
 return TRUE
end
 
Yeah:
Code:
				function onUse(cid, item, fromPosition, itemEx, toPosition)
 local time =
{
   sec = 30
}
	if getPlayerStorageValue(cid, 15321) == -1 then
	   doSummonCreature("Warlock", {x=212, y=225, z=10})
	   addEvent(funcSummonWarlock, time.sec * 1000)
	   setPlayerStorageValue(cid, 15321, 1)
 end
 return TRUE
end

function funcSummonWarlock()
	   doSummonCreature("Warlock", {x=208, y=224, z=10})
 return TRUE
end
 
Back
Top