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

Solved Remove MW

-.Ktz

New Member
Joined
Feb 11, 2016
Messages
37
Reaction score
1
Staff can anyone tell me what is wrong in this action?

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
   local wall = getThingfromPos({x=890, y=487, z=5, stackpos=1})
   if item.actionid == 8000 and item.itemid == 1945 and wall.itemid == 1497 then
     Item(wall.uid):remove()
     Item(item.uid):transform(1946)
   elseif item.actionid == 8000 and item.itemid == 1946 and wall.itemid == 0 then
     Game.createItem(1497, 1, {x=890, y=487, z=5, stackpos=1})
     Item(item.uid):transform(1945)
   end
   return true
end

TFS 1.2
 
Code:
local pos = Position(890, 487, 5)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
     local wall = Tile(pos):getItemById(1498)
     if wall then
         wall:remove()
     else
         Game.createItem(1498, 1, pos)
     end
     item:transform(item.itemid == 1945 and 1946 or 1945)
     return true
end
 
Back
Top