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

Lua Script for promotion.

data/creaturescripts/scripts/Prem.lua
LUA:
local days = xxxx --- Days of prem
function onLogin(cid)
if isPlayer(cid) then
   if getPlayerPremiumDays(cid) > 0 then
      doPlayerAddPremiumDays(cid,days)
   end
   return true
end
end

creaturescritps.xml
XML:
<event type="login" name="Prem" event="script" value="Prem.lua"/>

login.lua add:
LUA:
registerCreatureEvent(cid, "Prem")
 
Add somewhere into login.lua (after Function(........))
LUA:
if getPlayerPremiumDays(cid) >= 1 then
	if getPlayerPromotionLevel(cid) < 1 then
		doPlayerSetPromotionLevel(cid, 1)
		doSendMagicEffect(getCreaturePosition(cid),30)
		doPlayerSendTextMessage(cid,22,"You have been promoted!")
	end
end
 
Try this man:
LUA:
local t = {
[1] = {"You are now a master sorcerer",5},
[2] = {"You are now an elder druid",6},
[3] = {"You are now a royal paladin",7},
[4] = {"You are now an elite knight",8}
}

function onLogin(cid)
         ppos = getPlayerPosition(cid)
local v = t[getPlayerVocation(cid)]
    if t then
		if getPremiumDays >= 0 then
                doPlayerSetVocation(cid,v[2])
                doSendMagicEffect(ppos,5)
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
				setPlayerStorageValue(cid,7000,1)
			elseif getPlayerStorageValue(cid,7000) > 0 then
				doPlayerSendCancel(cid,"You have already been promoted")
       end
    return true
end
end
 
Add somewhere into login.lua (after Function(........))
LUA:
if getPlayerPremiumDays(cid) >= 1 then
	if getPlayerPromotionLevel(cid) < 1 then
		doPlayerSetPromotionLevel(cid, 1)
		doSendMagicEffect(getCreaturePosition(cid),30)
		doPlayerSendTextMessage(cid,22,"You have been promoted!")
	end
end
Use this :)
 
Back
Top