vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, i try create script for random addon doll, but my script give one addon and if player use doll again he dont get more addons ;/ And how to add blockade if player have addon, so scritp give next addon? And if player have all addons from doll, he can't use doll?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addons_male = {
381,
383,
385,
387,
389,
391,
393
}
local addons_famele = {
382,
384,
386,
388,
390,
392,
394
}
local msg = {"Congratulations! You get full random addon!"}
if(getPlayerItemCount(cid, 12716) > 0) then
doPlayerRemoveItem(cid, 12716, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
if(getPlayerSex(cid) == 0)then
for i = 1, #addons_famele do
local fameleaddon = addons_famele[i]
doPlayerAddOutfit(cid, fameleaddon, 3)
end
else
for i = 1, #addons_male do
local maleaddon = addons_male[i]
doPlayerAddOutfit(cid, maleaddon, 3)
end
end
end
return true
end