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

Solved onStepIn promotion

tozikrulz

New Member
Joined
Jun 10, 2009
Messages
46
Reaction score
1
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
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:
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
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

this?

Lua:
function onStepIn(cid, item, position, fromPosition)
    if getPlayerLevel(cid) >= 500 and getPlayerVocation(cid) == 9 and 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, true)
    end
return true
end

not tested
 
Lua:
local pos = {x=1000, y=1000, z=7}
function onStepIn(cid, item, position, fromPosition)
 
if getPlayerLevel(cid) >= 500 and getPlayerVocation(cid) == 9 and getPlayerItemCount(cid, 2159) >= 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

#EDIT

Damn /\ :D
 

Similar threads

Back
Top