ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Here is my script:
Now the problem is that you can get the marijuana from it, and then you have to wait 10 seconds, but then after the first 10 seconds are up, you can spam it and get one like every second. So what do I have to do like return false or return true or return 0 or what?
I'm posting this here because I posted it in support and got no help at all.
EDIT= Sorry, nevermind guys, it does work, it just didnt work in like "1 second "test mode"" but it works for longer periods of time. Sorry about posting it here too.
Code:
function restore(cid)
setPlayerStorageValue(cid, 1025, 1)
end
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 1025) == 1
then
setPlayerStorageValue(cid, 1025, 2)
doSendMagicEffect(getPlayerPosition(cid), 13)
doCreatureSay(cid, "You have come across some marijuana.", TALKTYPE_ORANGE_1)
doPlayerAddItem(cid, 5953, 1)
else
doCreatureSay(cid, "The plant has already been cut.", TALKTYPE_ORANGE_1)
addEvent(restore, 10 * 1000, cid)
end
end
Now the problem is that you can get the marijuana from it, and then you have to wait 10 seconds, but then after the first 10 seconds are up, you can spam it and get one like every second. So what do I have to do like return false or return true or return 0 or what?
I'm posting this here because I posted it in support and got no help at all.
EDIT= Sorry, nevermind guys, it does work, it just didnt work in like "1 second "test mode"" but it works for longer periods of time. Sorry about posting it here too.