sick
Member
Hello ,
I'm looking for some help with adding random chance of success when giving X item and receiving Y item. For example there is just 30% chance to receive Y item when giving out X item.
Thank for help in advance!
I'm looking for some help with adding random chance of success when giving X item and receiving Y item. For example there is just 30% chance to receive Y item when giving out X item.
Lua:
function obsidian(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerItemCount(cid,2157) >= 1 then
if randomChance == 1 then
if doPlayerRemoveItem(cid,2157,1) then
npcHandler:say('Here is your item!', cid)
doPlayerAddItem(cid,7764,1)
end
else
npcHandler:say('You don\'t have enough items!', cid)
end
end
Thank for help in advance!