function onUse(cid, item, fromPosition, itemEx, toPosition)
local wall, w_id = { x = 100, y= 100, z = 7, stackpos = 1 }, { 1050 }
if(item.itemid == 1945) then
if(getThingfromPos(wall).itemid == w_id) then
doRemoveItem(getThingfromPos(wall).uid)
end
elseif(item.itemid == 1946) then
doCreateItem(w_id, wall, 1)
end
return true
end
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) local wall, w_id = { x = 100, y= 100, z = 7, stackpos = 1 }, { 1050 } if(item.itemid == 1945) then if(getThingfromPos(wall).itemid == w_id) then doRemoveItem(getThingfromPos(wall).uid) end elseif(item.itemid == 1946) then doCreateItem(w_id, wall, 1) end return true end
if(getThingfromPos(wall).itemid == w_id) then
if isInArray(w_id, getThingfromPos(wall).itemid) then
function onUse(cid, item, fromPosition, itemEx, toPosition)
local wall, w_id = { x = 100, y= 100, z = 7, stackpos = 1 }, 1050
if(item.itemid == 1945) then
if(getThingFromPos(wall).itemid == w_id) then
doRemoveItem(getThingFromPos(wall).uid)
end
elseif(item.itemid == 1946) then
doCreateItem(w_id, wall, 1)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local wall, w_id = { x = 100, y= 100, z = 7, stackpos = 1 }, 1050
if(item.itemid == 1945) then
if(getThingfromPos(wall).itemid == w_id) then
doRemoveItem(getThingfromPos(wall).uid)
end
elseif(item.itemid == 1946) then
doCreateItem(w_id, wall, 1)
end
return true
end
local wall, w_id = {x = 100, y= 100, z = 7}, 1050
function onUse(cid, item, fromPosition, itemEx, toPosition)
return
TRUE,
item.itemid == 1945
and
doRemoveItem(getTileItemById(wall, w_id).uid)
or
item.itemid == 1946
and
doCreateItem(w_id, 1, wall)
end
Code:local wall, w_id = {x = 100, y= 100, z = 7}, 1050 function onUse(cid, item, fromPosition, itemEx, toPosition) return TRUE, item.itemid == 1945 and doRemoveItem(getTileItemById(wall, w_id).uid) or item.itemid == 1946 and doCreateItem(w_id, 1, wall) end
yes works -.-"oOoOoOoOoOoooOOOooOOooOo wtf
oOoOoOoOoOoooOOOooOOooOo wtf
ey it works ok?still dont working :S
attempt to compare table with numberCode:function onUse(cid, item, fromPosition, itemEx, toPosition) local w_pos, w_id = { x = 100, y= 100, z = 7 }, { 1050 } if(item.itemid == 1945) then local wall = getTileItemById(w_pos, w_id) if([B][COLOR="Red"]wall < 1[/COLOR][/B]) then doCreateItem(w_id, 1, w_pos) else doRemoveItem(wall.uid) end elseif(item.itemid == 1946) then doSendMagicEffect(fromPosition, CONST_ME_POFF) end return true end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local w_pos, w_id = { x = 100, y= 100, z = 7 }, { 1050 }
if(item.itemid == 1945) then
local wall = getTileItemById(w_pos, w_id)
if(wall.uid < 1) then
doCreateItem(w_id, 1, w_pos)
else
doRemoveItem(wall.uid)
end
elseif(item.itemid == 1946) then
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
return true
end
Have you changed the positions in the script?im doing that but i right click the lever and dont works and i dont get any error, just the wall dont dissappear/appear