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

When i level 20 i get a reward. Requests.

Erik

hi
Joined
Dec 12, 2008
Messages
260
Reaction score
9
Location
Sweden
When i hunt , i start a level 8 and i reach level 20. it says

Congratulation PLAYERNAME you have reached level 20, you will now be rewarded 2 crystal coin. Enjoy your hunting! ( ORANGE TEXT )

Rep+ Any script?

TFS 0.4_Dev
 
Try this:
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local level = 20
local playername = getCreatureName(cid)
	if getPlayerLevel(cid) == level and getPlayerStorageValue(cid, 44923) == -1 then
	setPlayerStorageValue(cid, 44923, 1)
	doPlayerAddItem(cid, 2160, 2)
    doCreatureSay(cid, "Congratulation .. playername .. you have reached level 20, you will now be rewarded 2 crystal coin. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
	return true
end
 
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, 2160, 2)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 20, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end
 
Creaturescript

XML:
<event type="advance" name="LevelReward" event="script" value="levelreward.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "LevelReward")

levelreward.lua
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, 2160, 2)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 20, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end
 
What should i change if i want same thing but level 50- Congratulations you have reach level 50, you will now be rewarded 5 crystal coins. Enjoy your hunting!
 
XML:
<event type="advance" name="LevelReward2" event="script" value="levelreward2.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "LevelReward2")

levelreward.lua
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41025) ~= 1 and newlevel >= 50) then
		setPlayerStorageValue(cid, 41025, 1)
		doPlayerAddItem(cid, 2160, 5)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 5 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end
 
you can also make it in 1 script :

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41025) ~= 1 and newlevel >= 50) then
		setPlayerStorageValue(cid, 41025, 1)
		doPlayerAddItem(cid, 2160, 5)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 5 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	elseif(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41022) ~= 1 and newlevel >= 20) then
		setPlayerStorageValue(cid, 41022, 1)
		doPlayerAddItem(cid, 2160, 2)
		doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
	end
return true
end
 
;o
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local levels = {20,50}
local storages = {41024, 41025}
if skill == SKILL__LEVEL and isInArray(storages,getPlayerStorageValue(cid)) < 0 and newlevel >= isInArray(levels,getPlayerLevel(cid)) then
	setPlayerStorageValue(cid, getPlayerLevel(cid) == levels[1] and storage[1] or getPlayerLevel(cid) == level[2] and storage[2], 1)
	doPlayerAddItem(cid, 2160, getPlayerLevel(cid) == levels[1] and 2 or getPlayerLevel(cid) == level[2] and 5)
    doCreatureSay(cid, "Congratulation .. playername .. you have reached level " .. getPlayerLevel(cid) .. ", you will now be rewarded " .. getPlayerLevel(cid) == levels[1] and 2 or getPlayerLevel(cid) == levels[2] and 5 .. " crystal coin. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
 
XML:
	<event type="advance" name="Reward" event="script" value="reward.lua"/>
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
       
        if(getPlayerStorageValue(cid, 60362) == -1 and skill == SKILL__LEVEL and newlevel >= 25) then
                doPlayerAddItem(cid, 2160, 1)
                setPlayerStorageValue(cid, 60362, 1)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_RED)
	local message = "You have received 1 crystal coin due to reaching level 25."
	doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
                doPlayerSendTextMessage(cid, 19, "You have received 1 crystal coin due to reaching level 25.")
                end
        return TRUE
end
 
Back
Top