ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Here is my script:
So I have them in the actions.xml as one line the itemid, and then they both have a uniqueid, but when I go up to each crystral it just gives me the "else" factor, huh????
Code:
function restore1029(cid)
setPlayerStorageValue(cid, 1025, 1)
return true
end
function restore1030(cid)
setPlayerStorageValue(cid, 1030, 1)
return true
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1029 and
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, (math.random(1, 3)))
else
doCreatureSay(cid, "The plant has already been cut.", TALKTYPE_ORANGE_1)
addEvent(restore1029, (math.random(15,120)) * 60 * 1000, cid)
return true
end
return true
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1030 and
getPlayerStorageValue(cid, 1030) == 1
then
setPlayerStorageValue(cid, 1030, 2)
doSendMagicEffect(getPlayerPosition(cid), 13)
doCreatureSay(cid, "You have come across some marijuana.", TALKTYPE_ORANGE_1)
doPlayerAddItem(cid, 5953, (math.random(1, 3)))
else
doCreatureSay(cid, "The plant has already been cut.", TALKTYPE_ORANGE_1)
addEvent(restore1030, (math.random(15,120)) * 60 * 1000, cid)
return true
end
return true
end
So I have them in the actions.xml as one line the itemid, and then they both have a uniqueid, but when I go up to each crystral it just gives me the "else" factor, huh????