Something like that:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
-- Define the reward pool with chances, types, and specific details
local rewardPool = {
{chance = 10, type = "item", id = 2160, count = 10}, -- 10x Crystal Coins
{chance = 5...