Kod:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Modify the itemTable variable to include the IDs of the items you want to include
local itemTable = {2649, 2461, 2214, 2213, 2209, 2207, 2208, 2172, 2171, 2170, 2161, 2173, 2197, 2198, 2199, 2200, 2125, 2218, 2201, 2130, 2129, 2126, 2133, 2131, 2133, 2190, 2191, 2189, 2188, 2657, 2659, 2658, 2655, 2654, 2653, 2652, 2651, 2508, 2650, 2148, 2152, 2160, 2157, 2154, 2155, 2153, 2156, 2158, 7141, 7142, 7143, 7144}
-- Get a random item ID from the table
local randomItem = itemTable[math.random(1, #itemTable)]
-- Remove the used item from the player's inventory
doRemoveItem(item.uid, 1)
-- Add the random item to the player's inventory
doPlayerAddItem(cid, randomItem, 1)
-- Add 1 to the player's egg count storage
local eggCount = getPlayerStorageValue(cid, egg)
eggCount = eggCount + 1
setPlayerStorageValue(cid, egg, eggCount)
-- Add a magic effect at the player's position
doSendMagicEffect(getCreaturePosition(cid), math.random(1,81))
return true
end
Zakładki