MadMOOK
Hoo
- Joined
- Apr 20, 2011
- Messages
- 802
- Reaction score
- 44
Description of what I want: I need the onuse script below to do the random attributes function of the random item stats script below! 
Thanks in advanced...
-Mook
here is the random stats creature script..
http://pastebin.com/BRFxxcng
Here is the on use function of my script I want chance of random stats on creation...

Thanks in advanced...
-Mook
here is the random stats creature script..
http://pastebin.com/BRFxxcng
Here is the on use function of my script I want chance of random stats on creation...
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x = 1934, y = 1989, z = 8}
for i, x in pairs(config) do
if getTileItemById(pos, i).uid > 0 then
if math.random(100) <= breakChance then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It couldn't bare the crafting magic.")
doSendMagicEffect(pos, CONST_ME_GROUNDSHAKER)
else
local rnd = x[math.random(1,#x)]
doPlayerAddItem(cid, rnd[1], rnd[2])
doSendMagicEffect(pos, CONST_ME_FIREWORK_YELLOW)
end
doRemoveItem(getTileItemById(pos,i).uid,1)
doTransformItem(item.uid, item.itemid == 9825 and 9826 or 9825)
return true
end
end