Strashni
minera.servegame.com
Hello,i need script for money reward at 45 lvl...if someone can help me
+rep!
tfs 0.3.5
+rep!
tfs 0.3.5
Last edited:
registerCreatureEvent(cid, "moneyAdvance")
<event type="advance" name="moneyAdvance" event="script" value="moneyAdvance.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
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
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
doPlayerSetStorageValue(cid, 65535)
doPlayerSetStorageValue(cid, 65535, 1)
Here's a mistake:
Change it to:Code:doPlayerSetStorageValue(cid, 65535)
Code:doPlayerSetStorageValue(cid, 65535, 1)