shass
Banned User
- Joined
- Dec 3, 2017
- Messages
- 67
- Reaction score
- 6
Well im using this script to remove mwall after x secconds, the problem is that if a player stand over the sqm where the mwall will appear at x secconds the mwall never appears again
please any lua coder could help me?
my serv is a tfs 0.3.7
also i tried to add it at movements item id 1498( so if a player stand over that item it will walk back) but nothing happens (now mwall appears but the char doesnto walk back)
please any lua coder could help me?
my serv is a tfs 0.3.7
Lua:
local pos = {x = 32259, y = 31891, z = 10, stackpos = 1} <- i've tried with numbers 1,10,0 and 7 no succes
local wall = 1498
local seconds = 10 -- use 0 to disable
local event = 0
local function reset(leverPos)
local lever = getTileItemById(leverPos, 1946).uid
doTransformItem(lever, 1945)
doCreateItem(wall, 1, pos)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(pos,wall).uid)
if seconds > 0 then
event = addEvent(reset, seconds * 1000, getThingPos(item.uid))
end
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 then
stopEvent(event)
doTransformItem(item.uid,item.itemid-1)
doCreateItem(wall, 1, pos)
end
return true
end
also i tried to add it at movements item id 1498( so if a player stand over that item it will walk back) but nothing happens (now mwall appears but the char doesnto walk back)
Last edited: