ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Here is my script
rocks
I'm getting an error with something about "setPlayerStorageValue <>. Player not found.
All I want it to do is this:
You use the thing and you get a rock, and then it takes a second for it to respawn so if you try to spam it, then it says to wait and you get nothing, but if you use it, then wait a second for it to respawn and use it again, then you get another rock, and then you have to wait again.
What is wrong with my script?
By the way, I have it set so "on login" if your storage value of 1024 is < 1, then it sets it to 1, so that is not the problem. The problem is I get a rock, but then it keeps telling me to wait forever and wont respawn.
rocks
Code:
function restore(cid, storage)
setPlayerStorageValue(cid, 1024, 1)
return true
end
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 1024) == 1
then
doSendMagicEffect(getPlayerPosition(cid), 13)
doCreatureSay(cid, "You have come across some rocks, keep collecting them.", TALKTYPE_ORANGE_1)
doPlayerAddItem(cid, 5953, 1)
setPlayerStorageValue(cid, 1024, 2)
addEvent(restore, 1000)
else
doCreatureSay(cid, "no rocks man, wait for more to form.", TALKTYPE_ORANGE_1)
return true
end
return true
end
I'm getting an error with something about "setPlayerStorageValue <>. Player not found.
All I want it to do is this:
You use the thing and you get a rock, and then it takes a second for it to respawn so if you try to spam it, then it says to wait and you get nothing, but if you use it, then wait a second for it to respawn and use it again, then you get another rock, and then you have to wait again.
What is wrong with my script?
By the way, I have it set so "on login" if your storage value of 1024 is < 1, then it sets it to 1, so that is not the problem. The problem is I get a rock, but then it keeps telling me to wait forever and wont respawn.