ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Heres my script
Now im having two problems, the first being that it removes the item, waits half a second, THEN puts the new item there (I want it to be all at once).
Also, after you mine it and it turns into the new object, it never returns back into its old self.
Code:
local rock = 4001 --put unique id of rock here
local respawnminimum = 1 --put minimum number of minutes for rock to respawn
local respawnmaximum = 1 --put maximum number of minutes for rock to respawn
local receiveminimum = .5 --put the lowest amount of the item you want to get here
local receivemaximum = 1 --put the maximum amount of the item you want to get here
local posa = {x=1094,y=1060,z=6}
local function restore(cid, storage)
setPlayerStorageValue(cid, rock, 1)
doRemoveItem(getTileItemById(posa, 8638).uid)
doCreateItem(8638, 1, posa)
return true
end
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 8634 and
getPlayerStorageValue(cid, rock) < 2
then
doRemoveItem(getTileItemById(posa, 8634).uid)
addEvent(restore, 1000, 5000, cid)
--setPlayerStorageValue(cid, rock, 2)
doSendMagicEffect(getPlayerPosition(cid), 13)
doCreatureSay(cid, "You mined it!", TALKTYPE_ORANGE_1)
elseif
getPlayerStorageValue(cid, rock) == 2
then
doCreatureSay(cid, "This rock has already been harvested, wait for it to grow back.", TALKTYPE_ORANGE_1)
return true
end
return true
end
Now im having two problems, the first being that it removes the item, waits half a second, THEN puts the new item there (I want it to be all at once).
Also, after you mine it and it turns into the new object, it never returns back into its old self.