helium101
New Member
- Joined
- Sep 15, 2016
- Messages
- 8
- Reaction score
- 1
I am having trouble with a script I'm attempting to write that will send a player to a certain coordinate based on their vocation upon use of an item. Apologies in advanced if this script is a mess, I'm a hobbyist and am doing my best to learn.
I'm running TFS 1.3 for Tibia 10.98.
This is what the script looks like thus far:
I'm running TFS 1.3 for Tibia 10.98.
This is what the script looks like thus far:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not(isPlayer(cid)) then return true end
if (player:getVocation():getID() == 1) or (player:getVocation():getID() == 5) then
function(player)
doCreatureSay(cid, "Welcome, Sorcerer!", TALKTYPE_ORANGE_1)
player:teleportTo(Position(32179, 31899, 8))
end
elseif (player:getVocation():getID() == 2) or (player:getVocation():getID() == 6) then
function(player)
doCreatureSay(cid, "Welcome, Druid!", TALKTYPE_ORANGE_1)
player:teleportTo(Position(32175, 31905, 8))
end
elseif (player:getVocation():getID() == 3) or (player:getVocation():getID() == 7) then
function(player)
doCreatureSay(cid, "Welcome, Paladin!", TALKTYPE_ORANGE_1)
player:teleportTo(Position(32184, 31890, 8))
end
elseif (player:getVocation():getID() == 4) or (player:getVocation():getID() == 8) then
function(player)
doCreatureSay(cid, "Welcome, Knight!", TALKTYPE_ORANGE_1)
player:teleportTo(Position(32175, 31890, 8))
end
end
end