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

Reward- script please

Ghazer

Member
Joined
Mar 13, 2009
Messages
350
Reaction score
6
I look script "reward for x level"
I want this...
level 20, 30 platinium
level 30, 1 crystal coin
level 40, 2 crystal coin
level 60, 5 crystal coin

and when level up, skill or magic give max hp and mana

Please!
 
Try this:

Level 20:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41024) ~= 1 and newlevel >= 20) then
		setPlayerStorageValue(cid, 41024, 1)
		doPlayerAddItem(cid, 3035, 30)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 20, you will now be rewarded 30 Platinum coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end

Level 30+:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41024) ~= [COLOR="#FF0000"]21[/COLOR] and newlevel >= [COLOR="#FF0000"]30[/COLOR]) then
		setPlayerStorageValue(cid, 41024, 1)
		doPlayerAddItem(cid, 3043, [COLOR="#FF0000"]1[/COLOR])
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level [COLOR="#FF0000"]30[/COLOR], you will now be rewarded [COLOR="#FF0000"]1 [/COLOR]Crystal coin. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end

What is in red is what you need to change to your in others levels.
 
Well if it is then go to Data>Creaturescript>Scripts make new lua file name reward.lua


Code:
local config = {
                levelReach = 30,
                item = 2160,
                count = 1
                }
 
function onAdvance(cid, skill, oldLevel, newLevel)
 
if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 100000) == -1) then
        setPlayerStorageValue(cid, 100000, 1)
        doPlayerAddItem(cid, config.item, config.count)
end
 
return TRUE
end

and in Creaturescripts.xml
Code:
<event type="advance" name="reward" event="script" value="reward.lua"/>
 
Back
Top