Amatorski skrypcik na Donator Box, czyli klikasz i losujesz itemek ; ). W skrypcie jest tylko 10 itemk?w, ale t? liczb? mo?na zwi?kszy? kopiuj?c ca?? tre?? elseif.
je?eli box ma losowa? wi?cej lub mniej ni? 10 item?w, musimy zmieni? warto?? drugiej liczby, w tym przypadku 10.
data/actions/scripts/donatorbox.lua
data/actions/actions.xml
je?eli box ma losowa? wi?cej lub mniej ni? 10 item?w, musimy zmieni? warto?? drugiej liczby, w tym przypadku 10.
Code:
local random = math.random(1,10)
data/actions/scripts/donatorbox.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
lol = getPlayerPosition(cid)
local random = math.random(1,10)
if random == 1 then
doPlayerAddItem(cid,2510,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Fusion Armor.")
doRemoveItem(item.uid, 1)
elseif random == 2 then
doPlayerAddItem(cid,2160,100)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a 100 Gold.")
doRemoveItem(item.uid, 1)
elseif random == 3 then
doPlayerAddItem(cid,2673,100)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a 100 Senzu.")
doRemoveItem(item.uid, 1)
elseif random == 4 then
doPlayerAddItem(cid,2469,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Goku SSj5 Legs.")
doRemoveItem(item.uid, 1)
elseif random == 5 then
doPlayerAddItem(cid,2478,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Gohan Legs.")
doRemoveItem(item.uid, 1)
elseif random == 6 then
doPlayerAddItem(cid,2487,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Gohan Armor.")
doRemoveItem(item.uid, 1)
elseif random == 7 then
doPlayerAddItem(cid,2655,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Super C17 Armor.")
doRemoveItem(item.uid, 1)
elseif random == 8 then
doPlayerAddItem(cid,2441,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Silver Glove.")
doRemoveItem(item.uid, 1)
elseif random == 9 then
doPlayerAddItem(cid,2442,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Saiyan Sword.")
doRemoveItem(item.uid, 1)
elseif random == 10 then
doPlayerAddItem(cid,5875,1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have got a Crashni Scroll of 10.000.000 experiance..")
doRemoveItem(item.uid, 1)
end
return TRUE
end
data/actions/actions.xml
Code:
<action itemid="id box'a" script="donatorbox.lua"/>