Hello,
well i have heard alot of complains about how to stop player or creatures from move. Well we know that we can add speed 0 to all, but it's not effective since, if they move, they will move but barley noticeable
So i made this simple function to add into your global.lua
How to use:
Cheers.
well i have heard alot of complains about how to stop player or creatures from move. Well we know that we can add speed 0 to all, but it's not effective since, if they move, they will move but barley noticeable
So i made this simple function to add into your global.lua
Code:
local function allowMovementEvent(cid, allow, oldPosition)
local creature = Creature(cid)
if not creature then
return false
end
if allow then
return stopEvent(event)
else
stopEvent(event)
end
creature:teleportTo(oldPosition, true)
event = addEvent(allowMovementEvent, 100, cid, allow, oldPosition)
end
function Creature.allowMovement(self, allow)
allowMovementEvent(self:getId(), allow, self:getPosition())
end
How to use:
Code:
player:allowMovement(false)
Cheers.