Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- robo
- --- Script By: X Zero ---
- function onUse(cid, item, frompos, item2, topos)
- local robo = 0
- local cooldown = 5
- 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 == 21660 then
- robo = 2182
- speed = 100
- vida = 20000
- elseif item.itemid == 17565 then
- robo = 2285
- speed = 200
- vida = 30000
- elseif item.itemid == 17566 then
- robo = 2286
- speed = 200
- vida = 30000
- elseif item.itemid == 17567 then
- robo = 2284
- speed = 200
- vida = 30000
- elseif item.itemid == 17568 then
- robo = 2335
- speed = 200
- vida = 30000
- end
- if getPlayerStorageValue(cid, 13101) == -1 then
- if 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 ---
- --bike
- local function BikeSpeedOn(cid, t)
- setPlayerStorageValue(cid, t.s, t.speed)
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doChangeSpeed(cid, t.speed)
- end
- local function BikeSpeedOff(cid, t)
- setPlayerStorageValue(cid, t.s, -1)
- doRegainSpeed(cid)
- end
- local t = {text='Hoverboard ON', dtext='Hoverboar OFF!', s=5700, speed = 4000}
- local exausted = 10 -- em minutos
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if isPlayer(cid) and getPlayerStorageValue(cid, 13101)-os.time() > 1 then
- local seetime = getPlayerStorageValue(cid, 13101)-os.time()
- local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
- doPlayerSendCancel(cid, "Aguarde "..seconds.." segundo(s) para usar novamente!")
- return false
- end
- local pos = getThingPos(cid)
- local outfit = getCreatureOutfit(cid)
- if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
- getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
- getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1
- or getPlayerStorageValue(cid, 9801) >= 1 then --alterado v1.9
- return doPlayerSendCancel(cid, "You can't do that right now.")
- end
- if getPlayerStorageValue(cid, t.s) <= 0 then
- doSendMagicEffect(pos, 177)
- doCreatureSay(cid, t.text, 19)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a Hoverboard.')
- setPlayerStorageValue(cid, 13101, exausted+os.time())
- BikeSpeedOn(cid, t)
- if getPlayerSex(cid) == 1 then
- doSetCreatureOutfit(cid, {lookType = 2168, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
- else
- doSetCreatureOutfit(cid, {lookType = 2169, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
- end
- else
- doSendMagicEffect(pos, 177)
- doCreatureSay(cid, t.dtext, 19)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a Hoverboard.')
- BikeSpeedOff(cid, t)
- doRemoveCondition(cid, CONDITION_OUTFIT)
- end
- return true
- end
- se vc conseguir por a funçao da bike no robo pra ganhar vida, seria melhor, eu consegui por, mas quando remove a vida extra ele buga o char, o char fica com 1 de vida
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement