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

Monster stop moving for x time

Dominik ms

Member
Joined
Jan 20, 2010
Messages
424
Reaction score
6
I am searching for script than can stop move selected Creature for x time.

That can be spell, function, cpp... all whats can me help!!
 
you can make your check to check if monster is still alive or no
LUA:
function returnSpeed(cid)
	doChangeSpeed(cid,getCreatureBaseSpeed(cid) )  -- give the monster back his speed (the one in his xml file)
	return true
end	
function stopFor(cid,time)
	doChangeSpeed(cid,  - getCreatureSpeed(cid))  -- set monster speed to 0 = monster stop moving
	addEvent(returnspeed,time,cid)
	return true
end
 
PHP:
function stopMonster(cid, time)
  doCreatureSetNoMove(cid, true)
  addEvent(function(monster) if(isCreature(monster)) then doCreatureSetNoMove(monster, false) end, time * 1000, cid)
end
It should work too. Shorter :P
 
Last edited:
When i push back speed to base speed then monster cant walk, why?? I dont know.
I must Teleport him to position with distance minimum 2 sqm.

Maybe some condition?? Or create new condition??
 
are u sure with that cuz it works perfectly with me,

Test
LUA:
function returnSpeed(cid)
	doChangeSpeed(cid,getCreatureBaseSpeed(cid) - getCreatureSpeed(cid) ) -- give the monster back his speed (the one in his xml file)
	return true
end	
function stopFor(cid,time)
	doChangeSpeed(cid,  0 - getCreatureSpeed(cid)) -- set monster speed to 0 = monster stop moving
	addEvent(returnSpeed,time,cid)
	return true
end



function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isMonster(itemEx.uid) then
		 stopFor(itemEx.uid,5*1000)
	else
		doPlayerSendCancel(cid,"It isn't a monster")
	end

return true
end
 
Back
Top