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

Why my script dont work? Its simple

  • Thread starter Deleted member 141899
  • Start date
D

Deleted member 141899

Guest
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if(item.actionid == 7800) then
if player:getlevel() => 80 then
if(item.itemid == 1257) then
doTeleportThing(cid, toPosition, true)
doTransformItem(item.uid, 1258)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The gate mechanism won't move. You probably have to find a way around until you figure out how to operate the gate.")
end
end
end
return true
end




Why dont work? the message dont apper and the door are sealed same for level 80+
 
  1. Please wrap your code in the [ code ] tags.
  2. Please provide the name of the codebase, the version you're running, and the Tibia client version you're serving.
  3. You're missing parenthesis on "if player:getlevel() => 80 then"
 
I'm assuming that you are using TFS 1.x

Remove the "if item.actionid == 7800" why did you put it there? U have to expecify the actionID on XML not in the script

player:getlevel is messed

change the door ID from 1257 to 1253 and 1258 to 1254

teleport is also messed.... Almost everything in your script is messed lol

Your code should be:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local position = player:getPosition()
    local pos = {x=positon, y=position, z=position} <-------- Set the positon here
 
        if getPlayerLevel(cid) >= 80 then
           if item.itemid == 1253 then
              doTeleportThing(cid, pos)
              doTransformItem(item.uid, 1254)
           elseif item.itemid == 1254 then
              doTransformItem(item.uid, 1253)
           end
        else
           player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The gate mechanism won't move. You probably have to find a way around until you figure out how to operate the gate.")
        end

return true
end
 
Back
Top