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

Script help.

Ufonica

New Member
Joined
Aug 3, 2018
Messages
55
Reaction score
0
Hello again,

I have been having a small problem with a promotion script i have made, everything works perfectly fine for it however when players log out and log back in they lose the promotion.

Is there anyway for me to be able to fix this in login.lua.

Client version is 8.6 and the tfs is 0.4

Thanks in advance.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
level = 1, --- level to use items
vocs = { 5, 6, 7, 8 }, --- put here vocation must use items 
storage = 452473991 --- set any empty storage
}
if(getPlayerStorageValue(cid, cfg.storage) == -1) then
if(getPlayerLevel(cid) >= cfg.level) then
if(isInArray(cfg.vocs, getPlayerVocation(cid)) == true) then
setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
doSendMagicEffect(getCreaturePosition(cid), 55)
setPlayerStorageValue(cid, cfg.storage, 1)
doRemoveItem(item.uid, 1)

else
doCreatureSay(cid, "Only players with first promotion may get their Second promotion.", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "Sorry, only characters of level " .. cfg.level .. " or above can buy Second Promotion.", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "You have already purchased the Second Promotion.", TALKTYPE_ORANGE_1)
end
return
end
 
Last edited by a moderator:
Solved via teamviewer.

They had their characters set to turn into the first promotion everytime they logged in via creaturescript.
 

Similar threads

Back
Top