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

Money reward at 45lvl

Strashni

minera.servegame.com
Joined
May 10, 2009
Messages
230
Reaction score
0
Location
Montenegro
Hello,i need script for money reward at 45 lvl...if someone can help me
+rep!

tfs 0.3.5
 
Last edited:
creaturescripts/scripts/login.lua
LUA:
registerCreatureEvent(cid, "moneyAdvance")

creaturescripts.xml
Code:
<event type="advance" name="moneyAdvance" event="script" value="moneyAdvance.lua"/>

moneyAdvance.lua
LUA:
function onAdvance(cid,skill,oldlevel,newlevel)

if getPlayerLevel(cid) == 45 and getPlayerStorageValue(cid,45000) == -1
	setPlayerStorageValue(cid,45000,1)
	doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Congratulations on achieving level 45!")
	doPlayerAddMoney(cid,10000)
end
return TRUE
end
 
wrong!

it will give if player advance in any skill and have the level 45.

Correct:
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
	if skill == SKILL__LEVEL then
		if newlevel >= 45 then
			if getPlayerStorageValue(cid, 65535) < 1 then
				local money = 10000
				doPlayerAddMoney(cid, money)
				doPlayerSetStorageValue(cid, 65535)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bla bla bla..")
			end
		end
	end
	return true
end
 
1st one doesn't work
2nd it give 5cc every time when u ding...so u can get there a lot of money..but i need script,u get money just one time on that char,at 45lvl!
 
wrong!

it will give if player advance in any skill and have the level 45.

Correct:
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
	if skill == SKILL__LEVEL then
		if newlevel >= 45 then
			if getPlayerStorageValue(cid, 65535) < 1 then
				local money = 10000
				doPlayerAddMoney(cid, money)
				doPlayerSetStorageValue(cid, 65535)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bla bla bla..")
			end
		end
	end
	return true
end

Here's a mistake:

Code:
doPlayerSetStorageValue(cid, 65535)
Change it to:
Code:
doPlayerSetStorageValue(cid, 65535, 1)
 
Back
Top