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

Door Open TFS 1.2

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi everyone, the main idea of the code below is, if is action 2684 then will open the door, but I'm getting a error with it:

bDsn16r.png


Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
   if(item.actionid == 2684) then
     local targetId = target:getId()
     if isInArray(openSpecialDoors, targetId) or isInArray(questDoors, targetId) or isInArray(levelDoors, targetId) then
       local itemId = item:getId()
       item:transform(itemId + 1)
       player:teleportTo(toPosition, true)
     end
   end
   return true
end

Other bug:

544E3vw.png

http://pastebin.com/nF5qQ6wy


Thanks.
 
Last edited:
Hi everyone, the main idea of the code below is, if is action 2684 then will open the door, but I'm getting a error with it:

bDsn16r.png


Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
   if(item.actionid == 2684) then
     local targetId = target:getId()
     if isInArray(openSpecialDoors, targetId) or isInArray(questDoors, targetId) or isInArray(levelDoors, targetId) then
       local itemId = item:getId()
       item:transform(itemId + 1)
       player:teleportTo(toPosition, true)
     end
   end
   return true
end

Other bug:

544E3vw.png

http://pastebin.com/nF5qQ6wy


Thanks.
First error: doesn't seem to think the target is an item. maybe try Item(target):getId()
Second error: line 34
Code:
if Tile(Position(x, y, fromPos.z)):getItemById(itemId) then
Try passing the individual values to the Tile class, I don't think it can accept a position object
Code:
if Tile(x, y, fromPos.z):getItemById(itemId) then
 
Back
Top