Way20
Well-Known Member
- Joined
- Sep 29, 2014
- Messages
- 227
- Solutions
- 3
- Reaction score
- 91
Well, I have a script that should give addons at after each 5 levels, I receive a mensagem (configured in script) but I don't receive the addon, I don't know what is wrong in this script, someone that know about LUA can help me with it? Here is the code.
Code:
local female_outfits = {
[135] = {outfit = 136, storage = 10136},
[140] = {outfit = 137, storage = 10137},
[145] = {outfit = 138, storage = 10138},
[150] = {outfit = 139, storage = 10139},
[155] = {outfit = 140, storage = 10140},
[160] = {outfit = 141, storage = 10141},
[165] = {outfit = 142, storage = 10142},
[170] = {outfit = 147, storage = 10147},
[175] = {outfit = 148, storage = 10148},
[180] = {outfit = 149, storage = 10149},
[185] = {outfit = 150, storage = 10150},
[190] = {outfit = 155, storage = 10155},
[195] = {outfit = 156, storage = 10156},
[200] = {outfit = 157, storage = 10157},
[205] = {outfit = 158, storage = 10158},
[210] = {outfit = 252, storage = 10252},
[215] = {outfit = 269, storage = 10269},
[220] = {outfit = 270, storage = 10270},
[225] = {outfit = 279, storage = 10279},
[230] = {outfit = 288, storage = 10288},
[235] = {outfit = 324, storage = 10324},
[240] = {outfit = 336, storage = 10336},
[245] = {outfit = 366, storage = 10366},
}
local male_outfits = {
[135] = {outfit = 128, storage = 10128},
[140] = {outfit = 129, storage = 10129},
[145] = {outfit = 130, storage = 10130},
[150] = {outfit = 131, storage = 10131},
[155] = {outfit = 132, storage = 10132},
[160] = {outfit = 133, storage = 10133},
[165] = {outfit = 134, storage = 10134},
[170] = {outfit = 143, storage = 10143},
[175] = {outfit = 144, storage = 10144},
[180] = {outfit = 145, storage = 10145},
[185] = {outfit = 146, storage = 10146},
[190] = {outfit = 151, storage = 10151},
[195] = {outfit = 152, storage = 10152},
[200] = {outfit = 153, storage = 10153},
[205] = {outfit = 154, storage = 10154},
[210] = {outfit = 251, storage = 10251},
[215] = {outfit = 268, storage = 10268},
[220] = {outfit = 273, storage = 10273},
[225] = {outfit = 278, storage = 10278},
[230] = {outfit = 289, storage = 10289},
[235] = {outfit = 325, storage = 10325},
[240] = {outfit = 335, storage = 10335},
[245] = {outfit = 367, storage = 10367},
}
function onAdvance(cid, skill, oldlevel, newLevel)
local main = nil
if getPlayerSex(cid) == 1 then
main = male_outfits[getPlayerLevel(cid)]
else
main = female_outfits[getPlayerLevel(cid)]
end
if skill == SKILL__LEVEL then
if main then
if getPlayerStorageValue(cid, main.storage) <= 0 then
doPlayerAddAddons(cid, main.outfit)
setPlayerStorageValue(cid, main.storage, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations you received a new addon!")
end
end
end
return true
end