sick
Member
So i got this script which doesn't work for me, i want it to give me 500exp when used and to have some % chance to randomly give 1 of some items, however it can also give no items. Anyone could fix this or make on working. Rep for for helper It doesn't give any errors it just doesn't work when used.
XML:
PHP:
local id = {5919, 5912, 6500, 5890}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(fromPosition.x ~= CONTAINER_POSITION) then
local randomChance = math.random(1, #id)
if(randomChance(1, 6) == 1) then
doPlayerAddItem(cid, id[randomChance])
doPlayerAddExp(cid, 500)
doCreatureSay(cid, "You Gained 500 Experience Points!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid,1)
end
return true
end
end
XML:
PHP:
<action itemid="10578" script="other/expscroll.lua"/>