--- Script By: X Zero ---
function onUse(cid, item, frompos, item2, topos)
local robo = 0
local cooldown = 3
local speed = 0
local stor = 92001
local vida = 0
if isRiderOrFlyOrSurf(cid) and not canFishWhileSurfingOrFlying then
doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
return true
end
if os.time() - getPlayerStorageValue(cid, 55695) >= cooldown then
setPlayerStorageValue(cid, 55695, os.time())
if item.itemid == 17588 then
robo = 3519
speed = 150
vida = 20000
elseif item.itemid == 17591 then
robo = 3521
speed = 200
vida = 30000
elseif item.itemid == 17592 then
robo = 3527
speed = 200
vida = 30000
elseif item.itemid == 17590 then
robo = 3525
speed = 200
vida = 30000
elseif item.itemid == 17589 then
robo = 3523
speed = 200
vida = 30000
end
if getPlayerStorageValue(cid, 92002) == -1 and getPlayerStorageValue(cid, 92003) == -1 then
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) and getPlayerStorageValue(cid, stor) == -1 then
doChangeSpeed(cid, speed)
doSetCreatureOutfit(cid, {lookType = robo, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
doSendAnimatedText(getCreaturePosition(cid), '[ROBO ON]', 32)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce montou no robo e ganhou vida extra.')
setPlayerStorageValue(cid, stor, 1)
setCreatureMaxHealth(cid, getPlayerLevel(cid) * 60 + vida)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
elseif (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) and getPlayerStorageValue(cid, stor) == 1 then
setPlayerStorageValue(cid, stor, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
doSendAnimatedText(getCreaturePosition(cid), '[ROBO OFF]', 32)
doChangeSpeed(cid, -speed)
setCreatureMaxHealth(cid, getPlayerLevel(cid) * 60)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerSendTextMessage(cid, MESSSAGE_STATUS_CONSOLE_ORANGE, 'Voce saiu do robo e perdeu a vida extra.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce nao pode subir nem descer do robo enquanto estiver em Batalha')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce nao pode usar a Moto/Robo/Bike ao mesmo tempo.')
end
else
doPlayerSendCancel(cid, "Aguarde "..(cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." segundos.")
end
return true
end
--- Script By: X ZERO ---