Grillo1995
New Member
Hi, I have this level reward script.
It works well, but if the player gets skill 30 he wins the first prize too, the script counts both level and up skills / ml.
How do I only win if I actually level LEVEL OF CHARACTER, not ML and skills? Thanks.
function onAdvance(player, level, oldlevel, newlevel)
Dont work for me ..
Code:
local crystal = 2160
local storage = 6095789
local storage2 = 6095790
local storage3 = 6095791
function onAdvance(player, skill, oldlevel, newlevel)
if newlevel >= 30 and player:getStorageValue(storage) ~= 10 then
player:setStorageValue(storage, 10)
player:setBankBalance(player:getBankBalance() + 10000)
--player:addItem(crystal, 1)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You receive 1 crystal coin in your bank.")
elseif newlevel >= 60 and player:getStorageValue(storage2) ~= 10 then
player:setStorageValue(storage2, 10)
player:setBankBalance(player:getBankBalance() + 30000)
--player:addItem(crystal, 3)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You receive 3 crystal coin in your bank.")
elseif newlevel >= 100 and player:getStorageValue(storage3) ~= 10 then
player:setStorageValue(storage3, 10)
player:setBankBalance(player:getBankBalance() + 60000)
--player:addItem(crystal, 6)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You receive 6 crystal coin in your bank.")
end
return true
end
function onLogin(player)
player:registerEvent("onadvance_reward")
return true
end
It works well, but if the player gets skill 30 he wins the first prize too, the script counts both level and up skills / ml.
How do I only win if I actually level LEVEL OF CHARACTER, not ML and skills? Thanks.
function onAdvance(player, level, oldlevel, newlevel)
Dont work for me ..
Last edited: