abdala ragab
Veteran OT User
action
2 promotion
3 promotion
4 promotion
These scripts worked for me in TFS version 1.2
Now after converting to 1.5 it does not work
If the player buys the second upgrade and logs out and back in, he gets the third promotion, and if he logs out and back in, he gets the fourth promotion, and so on
What is the problem and how can I fix it?
Thanks in advance
2 promotion
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local vocation = player:getVocation():getId()
if vocation >= 5 and vocation <= 8 then
vocation = vocation + 4
player:setVocation(vocation)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
item:remove()
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
end
return true
end
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local vocation = player:getVocation():getId()
if vocation >= 9 and vocation <= 12 then
vocation = vocation + 4
player:setVocation(vocation)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
item:remove()
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
end
return true
end
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local vocation = player:getVocation():getId()
if vocation >= 13 and vocation <= 16 then
vocation = vocation + 4
player:setVocation(vocation)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
item:remove()
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
end
return true
end
Now after converting to 1.5 it does not work
If the player buys the second upgrade and logs out and back in, he gets the third promotion, and if he logs out and back in, he gets the fourth promotion, and so on
What is the problem and how can I fix it?
Thanks in advance