function onUse(cid, item, frompos, item2, topos)
tempo = 10
tempo2 = tempo + 60
pos = getPlayerPosition(cid)
tilepos = {x=pos.x, y=pos.y, z=pos.z, stackpos=0}
tile = getThingfromPos(tilepos)
storage = 1533
storage2 = 1534
storage3 = 1535
bow = getPlayerStorageValue(cid,storage2)
bow2 = getPlayerStorageValue(cid,storage3)
timer1 = getPlayerStorageValue(cid,storage)
timer2 = os.time()
time = os.difftime(timer2, timer1)
add = timer2 + 1
if item.itemid == 2640 then
if bow2 == -1 then
setPlayerStorageValue(cid,storage,add)
setPlayerStorageValue(cid,storage2,-1)
setPlayerStorageValue(cid,storage3,1)
doRemoveItem(item.uid,1)
else
doPlayerSendCancel(cid,"You are already using water boots.")
end
return 1
end
if item.itemid ~= 2640 then
if timer1 >= 0 then
if time <= tempo then
doTeleportThing(cid,topos)
doSendMagicEffect(topos,53)
doSendMagicEffect(topos,1)
else
doPlayerSendCancel(cid,"Use the water boots for jump on the water.")
if bow > -2 then
doPlayerAddItem(cid,2640,1)
setPlayerStorageValue(cid,storage2,-2)
setPlayerStorageValue(cid,storage3,-1)
end
if time >= tempo2 then
if tile.itemid >= 4608 and tile.itemid <= 4625 then
doTeleportThing(cid,getPlayerMasterPos(cid))
doPlayerSendCancel(cid,22,"Use the water boots for jump on the water.")
setPlayerStorageValue(cid,storage,-1)
setPlayerStorageValue(cid,storage2,-1)
else
doPlayerSendCancel(cid,22,"Use the water boots for jump on the water.")
setPlayerStorageValue(cid,storage,-1)
setPlayerStorageValue(cid,storage2,-1)
end
end
end
else
return 0
end
end
return 1
end