blackfellow
New Member
- Joined
- May 31, 2011
- Messages
- 10
- Reaction score
- 0
hello,
i am trying to learn lua and am attempting to make a script for a quest but i need some help with it. I want to make it so that the player can not leave their tile and they have to use a water vial that appears beneath them and once they do it disappears and it reappears one tile in front of them and when it is used on the tile in front of them it disappears and reappears on the tile beneath them and so on. Then, after a certain amount of times a water puddle will appear on a certain tile.
Here is what i have gotten so far any help is appreciated thanks
i am trying to learn lua and am attempting to make a script for a quest but i need some help with it. I want to make it so that the player can not leave their tile and they have to use a water vial that appears beneath them and once they do it disappears and it reappears one tile in front of them and when it is used on the tile in front of them it disappears and reappears on the tile beneath them and so on. Then, after a certain amount of times a water puddle will appear on a certain tile.
Here is what i have gotten so far any help is appreciated thanks
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local posy = getPlayerPosition(cid) -- Returns the player's position
if item.itemuid == 2006 then
doRemoveItem(2006,1)
doCreateItem(2006,1,posy.y+1)
elseif item.itemuid == 2006 and itempos = (2006,1,posy.y+1) then
doRemoveItem(2006,1)
doCreateItem(2006,1,posy.y-2)
end
return true
end