• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

I need this script plx

josehhhxx

New Member
Joined
Aug 8, 2009
Messages
15
Reaction score
0
Hello otlanders
i need the next script fast plx
when player use palm add to player 10 coconuts
plx help :(



PD: sorry for my bad English
 
Code:
local cfg = {
    palm_id = 1234,
    coconut_id = 2345,
    count = 10, -- How many coconuts?
    minutes = 120, -- How many minutes before you can use the palm again?
    storage = 3456,
    }

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == cfg.palm_id then
        if getPlayerStorageValue(cid, cfg.storage) <= 0 then
            doPlayerAddItem(cid, cfg.coconut_id, cfg.count)
            setPlayerStorageValue(cid, cfg.storage, os.time() + (cfg.minutes * 60 * 1000))
        end
    end
return true
end
Test this one.
It will give the player 10 coconuts when he click on the palm, and give him a storage for X minutes, so you can't spam-click the coconut palm to get 13958394589385932 coconuts in 1 sec :p

I'm not sure it will work, like my first time using os.time, so I'm not sure i did it right!
 
Back
Top