Ahead
New Member
- Joined
- Dec 27, 2013
- Messages
- 165
- Reaction score
- 2
I got in my OT a creaturescript that recompense you if you reach X level. Well, it always worked fine but magically (of course, i do not know why if i did not touched anything) it got bugged. I will explain:
Here is the .lua
And here the problem:
When i log in with a lvl 8 player and i get ONE level more (to 9, although i get 12 because my server rates) i mysteriously receive 35 crystal coins and this item i put (a doll, doPlayerAddItem(cid, 10064, 1), even when they are for lvl 200). The thing i do not know is WHY now it works like that if before worked propely, you have to reach lvl 50 and incomings...
Thank you all. I hope to be understandable.
Here is the .lua
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
if(getPlayerStorageValue(cid, 99963) ~= 1 and newlevel >= 50) then
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "You have received 5 Crystal Coins because you reached level 45.")
end
if(getPlayerStorageValue(cid, 99964) ~= 1 and newlevel >= 100) then
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99964, 1)
doPlayerSendTextMessage(cid, 22, "You have received 5 Crystal Coins because you reached level 100.")
end
if(getPlayerStorageValue(cid, 99965) ~= 1 and newlevel >= 150) then
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99965, 1)
doPlayerSendTextMessage(cid, 22, "You have received 5 Crystal Coins and an Addon Doll because you reached level 150.")
end
if(getPlayerStorageValue(cid, 99966) ~= 1 and newlevel >= 200) then
doPlayerAddItem(cid, 2160, 10)
doPlayerAddItem(cid, 10064, 1)
setPlayerStorageValue(cid, 99966, 1)
doPlayerSendTextMessage(cid, 22, "You have received 5 Crystal Coins because you reached level 200.")
end
if(getPlayerStorageValue(cid, 99967) ~= 1 and newlevel >= 250) then
doPlayerAddItem(cid, 2160, 10)
setPlayerStorageValue(cid, 99967, 1)
doPlayerSendTextMessage(cid, 22, "You have received 5 Crystal Coins because you reached level 250.")
end
return TRUE
end
And here the problem:
When i log in with a lvl 8 player and i get ONE level more (to 9, although i get 12 because my server rates) i mysteriously receive 35 crystal coins and this item i put (a doll, doPlayerAddItem(cid, 10064, 1), even when they are for lvl 200). The thing i do not know is WHY now it works like that if before worked propely, you have to reach lvl 50 and incomings...
Thank you all. I hope to be understandable.