Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. -- robo
  2. --- Script By: X Zero ---
  3.  
  4. function onUse(cid, item, frompos, item2, topos)
  5.  
  6. local robo = 0
  7. local cooldown = 5
  8. local speed = 0
  9. local stor = 92001
  10. local vida = 0
  11.  
  12. if isRiderOrFlyOrSurf(cid) and not canFishWhileSurfingOrFlying then
  13. doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
  14. return true
  15. end
  16.  
  17. if os.time() - getPlayerStorageValue(cid, 55695) >= cooldown then
  18. setPlayerStorageValue(cid, 55695, os.time())
  19.  
  20. if item.itemid == 21660 then
  21. robo = 2182
  22. speed = 100
  23. vida = 20000
  24. elseif item.itemid == 17565 then
  25. robo = 2285
  26. speed = 200
  27. vida = 30000
  28. elseif item.itemid == 17566 then
  29. robo = 2286
  30. speed = 200
  31. vida = 30000
  32. elseif item.itemid == 17567 then
  33. robo = 2284
  34. speed = 200
  35. vida = 30000
  36. elseif item.itemid == 17568 then
  37. robo = 2335
  38. speed = 200
  39. vida = 30000
  40. end
  41.  
  42. if getPlayerStorageValue(cid, 13101) == -1 then
  43. if getPlayerStorageValue(cid, stor) == -1 then
  44. doChangeSpeed(cid, speed)
  45. doSetCreatureOutfit(cid, {lookType = robo, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
  46. doSendAnimatedText(getCreaturePosition(cid), '[ROBO ON]', 32)
  47. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce montou no robo e ganhou vida extra.')
  48. setPlayerStorageValue(cid, stor, 1)
  49. setCreatureMaxHealth(cid, getPlayerLevel(cid) * 60 + vida)
  50. doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
  51. elseif (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) and getPlayerStorageValue(cid, stor) == 1 then
  52. setPlayerStorageValue(cid, stor, -1)
  53. doRemoveCondition(cid, CONDITION_OUTFIT)
  54. doSendAnimatedText(getCreaturePosition(cid), '[ROBO OFF]', 32)
  55. doChangeSpeed(cid, -speed)
  56. setCreatureMaxHealth(cid, getPlayerLevel(cid) * 60)
  57. doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
  58. doPlayerSendTextMessage(cid, MESSSAGE_STATUS_CONSOLE_ORANGE, 'Voce saiu do robo e perdeu a vida extra.')
  59. else
  60. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce nao pode subir nem descer do robo enquanto estiver em Batalha')
  61. end
  62. else
  63. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce nao pode usar a Moto/Robo/Bike ao mesmo tempo.')
  64. end
  65. else
  66. doPlayerSendCancel(cid, "Aguarde "..(cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." segundos.")
  67. end
  68. return true
  69. end
  70.  
  71.  
  72. --- Script By: X ZERO ---
  73.  
  74.  
  75.  
  76.  
  77.  
  78. --bike
  79.  
  80. local function BikeSpeedOn(cid, t)
  81. setPlayerStorageValue(cid, t.s, t.speed)
  82. doChangeSpeed(cid, -getCreatureSpeed(cid))
  83. doChangeSpeed(cid, t.speed)
  84. end
  85.  
  86. local function BikeSpeedOff(cid, t)
  87. setPlayerStorageValue(cid, t.s, -1)
  88. doRegainSpeed(cid)
  89. end
  90.  
  91. local t = {text='Hoverboard ON', dtext='Hoverboar OFF!', s=5700, speed = 4000}
  92.  
  93. local exausted = 10 -- em minutos
  94.  
  95. function onUse(cid, item, fromPosition, itemEx, toPosition)
  96.  
  97. if isPlayer(cid) and getPlayerStorageValue(cid, 13101)-os.time() > 1 then
  98. local seetime = getPlayerStorageValue(cid, 13101)-os.time()
  99. local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
  100. doPlayerSendCancel(cid, "Aguarde "..seconds.." segundo(s) para usar novamente!")
  101. return false
  102. end
  103.  
  104. local pos = getThingPos(cid)
  105. local outfit = getCreatureOutfit(cid)
  106.  
  107.  
  108.  
  109. if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
  110. getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
  111. getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1
  112. or getPlayerStorageValue(cid, 9801) >= 1 then --alterado v1.9
  113.  
  114. return doPlayerSendCancel(cid, "You can't do that right now.")
  115. end
  116.  
  117. if getPlayerStorageValue(cid, t.s) <= 0 then
  118. doSendMagicEffect(pos, 177)
  119. doCreatureSay(cid, t.text, 19)
  120. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a Hoverboard.')
  121. setPlayerStorageValue(cid, 13101, exausted+os.time())
  122. BikeSpeedOn(cid, t)
  123. if getPlayerSex(cid) == 1 then
  124. doSetCreatureOutfit(cid, {lookType = 2168, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
  125. else
  126. doSetCreatureOutfit(cid, {lookType = 2169, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)
  127. end
  128. else
  129. doSendMagicEffect(pos, 177)
  130. doCreatureSay(cid, t.dtext, 19)
  131. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a Hoverboard.')
  132. BikeSpeedOff(cid, t)
  133. doRemoveCondition(cid, CONDITION_OUTFIT)
  134. end
  135. return true
  136. end
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145. 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