Hello,
The script below is meant to promote you when you step on the tile if you meet the requirements (being level 500, being a 2nd tier vocation [in this case, an enlightened sorcerer, id = 9] and have 100kk in inventory).
The script will promote you, take your money and teleport you if you meet the requirements which is good, but it will not send you the message or teleport you if you do not meet one of the requirements.
This is frustrating as i have tried many variations and still have not achieved what i wanted.
It also does not return any errors.
Please could someone smarter than me explain why this is not working and possibly show me where i have gone wrong?
Thank you.
Tozik
TFS 0.4
This is a variation i tried which i would also be happy with but it doesn't work.
The script below is meant to promote you when you step on the tile if you meet the requirements (being level 500, being a 2nd tier vocation [in this case, an enlightened sorcerer, id = 9] and have 100kk in inventory).
The script will promote you, take your money and teleport you if you meet the requirements which is good, but it will not send you the message or teleport you if you do not meet one of the requirements.
This is frustrating as i have tried many variations and still have not achieved what i wanted.
It also does not return any errors.
Please could someone smarter than me explain why this is not working and possibly show me where i have gone wrong?
Thank you.
Tozik
TFS 0.4
Lua:
local pos = {x=1000, y=1000, z=7}
function onStepIn(cid, item, position, fromPosition)
if getPlayerLevel(cid) >= 500 then
if getPlayerVocation(cid) ==9 then
if getPlayerItemCount(cid,2159) >= 100 then
doPlayerRemoveItem(cid,2159,100)
doPlayerSetVocation(cid, 13)
doTeleportThing(cid, pos, true)
elseif getPlayerLevel(cid) < 500 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, You Need to be Level 500 to pass")
doTeleportThing(cid, pos, false)
elseif getPlayerVocation(cid) < 9 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, You Need to be enlightened to pass")
doTeleportThing(cid, pos, false)
elseif getPlayerItemCount(cid,2159) < 100 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, You Need to have 100kk to pass")
doTeleportThing(cid, pos, false)
end
end
end
end
This is a variation i tried which i would also be happy with but it doesn't work.
Lua:
local pos = {x=1000, y=1000, z=7}
function onStepIn(cid, item, position, fromPosition)
if getPlayerLevel(cid) >= 500 then
if getPlayerVocation(cid) ==9 then
if getPlayerItemCount(cid,2159) >= 100 then
doPlayerRemoveItem(cid,2159,100)
doPlayerSetVocation(cid, 13)
doTeleportThing(cid, pos, true)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, You Need to have 100kk, be level 500 and be enlightened to pass")
doTeleportThing(cid, pos, false)
end
end
end
end
Last edited: