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

Windows how to do teleport only for premium players tibia 8.70

zdzisek

New Member
Joined
Aug 30, 2009
Messages
48
Reaction score
0
Hi i want to do teleport or doors only for players that have premium accounts but i don't know how to do this can somebody help me please.I also want to do a doll or some stone that will give 30 premium days for players.please help me.thank you very much:D
 
LUA:
function onUse(cid, item, frompos, item2, topos)
         if isPremium(cid) then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
               if pos.y < topos.y then
                  pos.y = topos.y + 1
               else
                  pos.y = topos.y - 1
               end
            elseif pos.y == topos.y then
                   if pos.x < topos.x then
                      pos.x = topos.x + 1
                   else
                      pos.x = topos.x - 1
                   end
            else
                doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
            return true
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
         else
            doPlayerSendTextMessage(cid,22,'Only Premium Accounts can go there.')
         end
         return true
end

Set actionID 54800 to the door and add this to actions.xml

LUA:
<action actionid="54800" event="script" value="premdoor.lua" />
 
1 - Go to data/actions/scripts
2 - Copy and paste any script there
3 - Rename it to "premdoor.lua"
4 - Paste the script on it
LUA:
function onUse(cid, item, frompos, item2, topos)
         if isPremium(cid) then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
               if pos.y < topos.y then
                  pos.y = topos.y + 1
               else
                  pos.y = topos.y - 1
               end
            elseif pos.y == topos.y then
                   if pos.x < topos.x then
                      pos.x = topos.x + 1
                   else
                      pos.x = topos.x - 1
                   end
            else
                doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
            return true
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
         else
            doPlayerSendTextMessage(cid,22,'Only Premium Accounts can go there.')
         end
         return true
end
5 - Open actions.xml in data/actions
6 - Paste the line
LUA:
<action actionid="54800" event="script" value="premdoor.lua" />
7 - Open map editor, put the door where player needs premium and set it's actionID to 54800

PS: Next time you can do it yourself, right? :]
 
This is the script that u need to put on data/actions/scripts/premiumdaysdoll.lua
LUA:
function onUse(cid, item, fromPos, item2, toPos)
if getPlayerPremiumDays(cid) < 330 then
doPlayerAddPremiumDays(cid, 30)
doRemoveItem(item.uid)
end
return true
end
And this is the registration on actions.xml:
XML:
<action itemid="55763" event="script" value="premiumdaysdoll.lua" />

You need to replace the 55763 for the doll's itemid....

EDIT: Now the doll remove.... ^^
 
Last edited:
Back
Top