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

Lua LUA question

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,019
Solutions
1
Reaction score
1,029
Location
United States
Does anyone know how to use the doCreatureSetNoMove(cid, cannotMove) function?
I'm trying to make a trap, where if you step in it, you will not be able to move for 3 seconds then you can move again. Right now, I'm at lost for ideas.
 
Code:
[16:10:50.497] [Error - MoveEvents Interface]
[16:10:50.498] In a timer event called from:
[16:10:50.499] data/movements/scripts/trapper.lua:onStepIn
[16:10:50.500] Description:
[16:10:50.502] (luaDoCreatureSetNoMove) Creature not found
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	doSendMagicEffect(getCreaturePosition(cid), 6)
	addEvent(noMove, 5000, cid)
	doRemoveItem(item.uid)
	return true
end

function noMove()
	doCreatureSetNoMove(cid, TRUE) 
	addEvent(doMove, 0, cid)
	end
	
function doMove()
	doCreatureSetNoMove(cid, FALSE) 
	end
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	doSendMagicEffect(getCreaturePosition(cid), 6)
	addEvent(noMove, 5000, cid)
	doRemoveItem(item.uid)
	return true
end
 
function cannotMove(cid)
doCreatureSetNoMove(cid, true)
addEvent(canMove, 10 * 1000, cid)
end
 
local function canMove(cid)
	doCreatureSetNoMove(cid, false)
end
 
Isnt it easier without functions?
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doCreatureSetNoMove(cid, true)
addEvent(doCreatureSetNoMove, 1000*180, cid, false)
return true
end
 
Back
Top