• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

On Advance

freak15

Professional Hoster
Joined
Dec 31, 2008
Messages
356
Reaction score
2
Location
Sweden
I serched for a script but i cant find it so i try request it here XD

i need a script when i advance to level 60 i get 100k
and no buggy script so the player can die to 59 and than take 60 again and get 100k more xD

and please if u got time explain where i put the script thankz bye otland

<(3
 
Or use the professional way, save storage values don't waste a storage value for each thing you do!

Implement this system according to the instructions: http://otland.net/f163/check-get-set-toggle-player-setting-status-use-only-one-storage-value-51787/


Now after you've implemented it, in the _SETTINGS table add (which should be in 'settings.lua'):
LUA:
HAS_REACHED_LEVEL_60 = 1

As this is most likely your first time using it, I could tell you that it will look like this in its whole:
LUA:
_SETTINGS = {
    HAS_REACHED_LEVEL_60 = 0
}


Now if you've succeeded doing that (hope you have, because I don't see what's so hard following my instructions in that thread and adding a field), here is the final onAdvance code:

LUA:
local reward = {
	level = 60,
    itemid = 2160,
    count = 100
}

function onAdvance(cid, skill, oldlevel, newlevel)
    if(skill == SKILL__LEVEL newlevel >= reward.level and getPlayerSettingStatus(cid, _SETTINGS.HAS_REACHED_LEVEL_60) then
        doPlayerAddItem(cid, reward.itemid, reward.count)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved " .. reward.count .. "x " .. getItemNameById(reward.itemid) .. ".")
        setPlayerSettingStatus(cid, _SETTINGS.HAS_REACHED_LEVEL_60)
        return true
    end
end


Start using this instead, by using setPlayerSettingStatus you will save a lot of storage values. If you'd have replaced that with each of your wasted storage values in our server you'd skip this mess "omg is this storage used? which storage should i use?? maybe its used!!!"
 
Last edited:
Alright, fixed a bug :p

Make sure to copy from the thread I wrote too (if you already have you don't need to do it again). Copy the new onAdvance code it's updated.
 
This will work, easier too.

Not Tested!
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
	levelReach = 60,
	item = 2160,
	count = 100
}
	if(skill == SKILL__LEVEL and newlevel >= config.levelReach and getPlayerStorageValue(cid, 9899) ~= 1) then
		setPlayerStorageValue(cid, 9899, 1)
		doPlayerAddItem(cid, config.item, config.count)
	end
		return TRUE
end
 
Back
Top