Advertisement
Upscalefanatic34

Project

May 25th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. forward = "w"
  2. back = "s"
  3. left = "a"
  4. right = "d"
  5. up = "r"
  6. down = "f"
  7.  
  8. fo = false
  9. ba = false
  10. le = false
  11. ri = false
  12. u = false
  13. d = false
  14.  
  15. player = game.Players.Upscalegaming
  16. character = player.Character
  17. torso = character.Torso
  18.  
  19. hopper = Instance.new("HopperBin")
  20. hopper.Parent = player.Backpack
  21. hopper.Name = "Fly"
  22. script.Parent = hopper
  23.  
  24. stuff = false
  25.  
  26. a = Instance.new("Part")
  27. a.Parent = game.Lighting
  28. a.Shape = "Ball"
  29. a.Size = Vector3.new(3,3,3)
  30. a.TopSurface = 0
  31. a.BottomSurface = 0
  32. a.Anchored = false
  33. a.CanCollide = false
  34. a.BrickColor = BrickColor.new("Bright blue")
  35. a.Reflectance = 0.2
  36. a.Transparency = 1
  37. bp = Instance.new("BodyPosition")
  38. bp.Parent = nil
  39. bp.maxForce = Vector3.new(1000000000,1000000000,1000000000)
  40. bp.position = torso.Position
  41. av = Instance.new("BodyAngularVelocity")
  42. av.Parent = nil
  43. av.maxTorque = Vector3.new(1000000000,1000000000,1000000000)
  44. av.angularvelocity = Vector3.new(0,0,0)
  45. weld = Instance.new("Weld")
  46. weld.Parent = a
  47. weld.Part0 = weld.Parent
  48. weld.Part1 = torso
  49. weld.C1 = CFrame.new(0,0,0)
  50.  
  51. function selected(mouse, key)
  52. stuff = true
  53. mouse.KeyDown:connect(function(key)
  54. key = key:lower()
  55. if (key == forward) then
  56. fo = true
  57. while fo == true do
  58. bp.position = bp.position + Vector3.new(0,0,-1.5)
  59. av.angularvelocity = Vector3.new(-5,0,0)
  60. wait()
  61. end
  62. elseif (key == back) then
  63. ba = true
  64. while ba == true do
  65. bp.position = bp.position + Vector3.new(0,0,1.5)
  66. av.angularvelocity = Vector3.new(5,0,0)
  67. wait()
  68. end
  69. elseif (key == left) then
  70. le = true
  71. while le == true do
  72. bp.position = bp.position + Vector3.new(-1.5,0,0)
  73. av.angularvelocity = Vector3.new(0,0,5)
  74. wait()
  75. end
  76. elseif (key == right) then
  77. ri = true
  78. while ri == true do
  79. bp.position = bp.position + Vector3.new(1.5,0,0)
  80. av.angularvelocity = Vector3.new(0,0,-5)
  81. wait()
  82. end
  83. elseif (key == down) then
  84. d = true
  85. while d == true do
  86. bp.position = bp.position + Vector3.new(0,-1.5,0)
  87. av.angularvelocity = Vector3.new(0,5,0)
  88. wait()
  89. end
  90. elseif (key == up) then
  91. u = true
  92. while u == true do
  93. bp.position = bp.position + Vector3.new(0,1.5,0)
  94. av.angularvelocity = Vector3.new(0,-5,0)
  95. wait()
  96. end
  97. end
  98. end)
  99. mouse.KeyUp:connect(function(key)
  100. key = key:lower()
  101. if (key == forward) then
  102. fo = false
  103. av.angularvelocity = Vector3.new(0,0,0)
  104. elseif (key == back) then
  105. ba = false
  106. av.angularvelocity = Vector3.new(0,0,0)
  107. elseif (key == left) then
  108. le = false
  109. av.angularvelocity = Vector3.new(0,0,0)
  110. elseif (key == right) then
  111. ri = false
  112. av.angularvelocity = Vector3.new(0,0,0)
  113. elseif (key == up) then
  114. u = false
  115. av.angularvelocity = Vector3.new(0,0,0)
  116. elseif (key == down) then
  117. d = false
  118. av.angularvelocity = Vector3.new(0,0,0)
  119. end
  120. end)
  121. a.Parent = character
  122. bp.Parent = torso
  123. bp.position = a.Position + Vector3.new(0,4,0)
  124. av.Parent = torso
  125. character.Humanoid.PlatformStand = true
  126. end
  127.  
  128. function deselect()
  129. fo = false
  130. ba = false
  131. le = false
  132. ri = false
  133. u = false
  134. d = false
  135. a.Parent = game.Lighting
  136. character.Humanoid.PlatformStand = false
  137. bp.Parent = nil
  138. av.Parent = nil
  139. stuff = false
  140. end
  141.  
  142. script.Parent.Selected:connect(selected)
  143. script.Parent.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement