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

Teleport on Use (Crying damson 0.3.6 / Tibia 8.6)

IamRbl

New Member
Joined
Nov 2, 2023
Messages
1
Reaction score
0
i have tried having a look but can't find anything i apologise if its already out there...

i am looking for abit of help with a script. as shown in the picture i have Minecarts w/ Levers, that i want to use to transport from City to city (Pretty similar to how they
work in Kazordoon)Screenshot 2024-02-21 193219.png..
Currently on my map i only have 2 cities ( I'm looking at adding more)
my plan is;
- Only level 200+ can travel
- it costs 50 CC to use.
Lever ID - 9825
 
Well, you can find a lot of pages that solves every single problem. As I'm a user of TSF 0.3.6 so I'll explain in "my language" (after a while I saw that you use it too! heheh)

Your code will be something like:

Lua:
local CC = 1234 -- id of CC (coconut coins?)
local newpos = {x=999, y=888, z=7} -- insert your teleport destination here
function onUse( cid, item, fromPosition, itemEx, toPosition )

if getPlayerLevel(cid) < 200 then
doPlayerSendTextMessage(cid, 1, 'sorry, you are under level 200')
return true
end

if getPlayerItemCount(cid, CC) >= 50 then
doPlayerRemoveItem(cid, CC, 50)
doTeleportThing(cid, newpos)
else
doPlayerSendTextMessage(cid, 1, 'sorry, you dont have enough coconut coins')
end

return true
end

And you must add the ActionID in your lever using the your Map Editor
And you must declare your code in actions.xml (just follow the other examples you have in this archive)

I know it's not easy to script, but it's so much important as having a map in your OTServer xD. When you look into Google for those questions, try it something like "lever script OTland" and you'll find many examples out there!

Good luck =)
 
Back
Top