Bruce Leal
New Member
- Joined
- Nov 9, 2017
- Messages
- 77
- Reaction score
- 3
Code:
local levelReward = {
[30] = 3,
[50] = 5,
[100] = 10
}
function onAdvance(cid, skill, oldLevel, newLevel)
doCreatureAddHealth(cid, getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMana(cid))
for k, v in pairs(levelReward) do
if newLevel == k and getPlayerStorageValue(cid, 3746) < k then
doPlayerAddItem(cid, 2160, v, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations, you\'ve received "..v.." crystal coins as a reward for level "..k..".")
setPlayerStorageValue(cid, 3746, k)
end
end
return true
end
Player will receive only 1 item with uniqueid 1980 such as the example 2160 but with uniqueID 1980, somebody can helpme to do?