Cbxbxjx

FE Ball

Dec 11th, 2021
1,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.90 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2. local RunService = game:GetService("RunService")
  3. local Camera = workspace.CurrentCamera
  4.  
  5. local SPEED_MULTIPLIER = 30
  6. local JUMP_POWER = 60
  7. local JUMP_GAP = 0.3
  8.  
  9. local character = game.Players.LocalPlayer.Character
  10.  
  11. for i,v in ipairs(character:GetDescendants()) do
  12. if v:IsA("BasePart") then
  13. v.CanCollide = false
  14. end
  15. end
  16.  
  17. local ball = character.HumanoidRootPart
  18. ball.Shape = Enum.PartType.Ball
  19. ball.Size = Vector3.new(5,5,5)
  20. local humanoid = character:WaitForChild("Humanoid")
  21. local params = RaycastParams.new()
  22. params.FilterType = Enum.RaycastFilterType.Blacklist
  23. params.FilterDescendantsInstances = {character}
  24.  
  25. local tc = RunService.RenderStepped:Connect(function(delta)
  26. ball.CanCollide = true
  27. humanoid.PlatformStand = true
  28. if UserInputService:GetFocusedTextBox() then return end
  29. if UserInputService:IsKeyDown("W") then
  30. ball.RotVelocity -= Camera.CFrame.RightVector * delta * SPEED_MULTIPLIER
  31. end
  32. if UserInputService:IsKeyDown("A") then
  33. ball.RotVelocity -= Camera.CFrame.LookVector * delta * SPEED_MULTIPLIER
  34. end
  35. if UserInputService:IsKeyDown("S") then
  36. ball.RotVelocity += Camera.CFrame.RightVector * delta * SPEED_MULTIPLIER
  37. end
  38. if UserInputService:IsKeyDown("D") then
  39. ball.RotVelocity += Camera.CFrame.LookVector * delta * SPEED_MULTIPLIER
  40. end
  41. --ball.RotVelocity = ball.RotVelocity - Vector3.new(0,ball.RotVelocity.Y/50,0)
  42. end)
  43.  
  44. UserInputService.JumpRequest:Connect(function()
  45. local result = workspace:Raycast(
  46. ball.Position,
  47. Vector3.new(
  48. 0,
  49. -((ball.Size.Y/2)+JUMP_GAP),
  50. 0
  51. ),
  52. params
  53. )
  54. if result then
  55. ball.Velocity = ball.Velocity + Vector3.new(0,JUMP_POWER,0)
  56. end
  57. end)
  58.  
  59. Camera.CameraSubject = ball
  60. humanoid.Died:Connect(function() tc:Disconnect() end)
  61.  
  62. wait(0.5)
  63.  
  64. local Speed = 60
  65.  
  66. -- Gui to Lua
  67. -- Version: 3.2
  68. local HumanoidRP = game.Players.LocalPlayer.Character.HumanoidRootPart
  69. -- Instances:
  70.  
  71. local ScreenGui = Instance.new("ScreenGui")
  72. local W = Instance.new("TextButton")
  73. local S = Instance.new("TextButton")
  74. local A = Instance.new("TextButton")
  75. local D = Instance.new("TextButton")
  76. local Fly = Instance.new("TextButton")
  77. local unfly = Instance.new("TextButton")
  78. local StopFly = Instance.new("TextButton")
  79.  
  80. --Properties:
  81.  
  82. ScreenGui.Parent = game.CoreGui
  83. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  84.  
  85. unfly.Name = "unfly"
  86. unfly.Parent = ScreenGui
  87. unfly.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  88. unfly.Position = UDim2.new(0.694387913, 0, 0.181818187, 0)
  89. unfly.Size = UDim2.new(0, 72, 0, 50)
  90. unfly.Font = Enum.Font.SourceSans
  91. unfly.Text = "unfly"
  92. unfly.TextColor3 = Color3.fromRGB(170, 0, 255)
  93. unfly.TextScaled = true
  94. unfly.TextSize = 14.000
  95. unfly.TextWrapped =
  96. unfly.MouseButton1Down:Connect(function()
  97. HumanoidRP:FindFirstChildOfClass("BodyVelocity"):Destroy()
  98. HumanoidRP:FindFirstChildOfClass("BodyGyro"):Destroy()
  99. end)
  100.  
  101. StopFly.Name = "Stop Fly"
  102. StopFly.Parent = ScreenGui
  103. StopFly.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  104. StopFly.Position = UDim2.new(0.695689976, 0, 0.0213903747, 0)
  105. StopFly.Size = UDim2.new(0, 71, 0, 50)
  106. StopFly.Font = Enum.Font.SourceSans
  107. StopFly.Text = "Stop fly"
  108. StopFly.TextColor3 = Color3.fromRGB(170, 0, 255)
  109. StopFly.TextScaled = true
  110. StopFly.TextSize = 14.000
  111. StopFly.TextWrapped = true
  112. StopFly.MouseButton1Down:Connect(function()
  113. HumanoidRP.Anchored = true
  114. end)
  115.  
  116. Fly.Name = "Fly"
  117. Fly.Parent = ScreenGui
  118. Fly.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  119. Fly.Position = UDim2.new(0.588797748, 0, 0.0213903747, 0)
  120. Fly.Size = UDim2.new(0, 66, 0, 50)
  121. Fly.Font = Enum.Font.SourceSans
  122. Fly.Text = "Fly"
  123. Fly.TextColor3 = Color3.fromRGB(170, 0, 127)
  124. Fly.TextScaled = true
  125. Fly.TextSize = 14.000
  126. Fly.TextWrapped = true
  127. Fly.MouseButton1Down:Connect(function()
  128. local BV = Instance.new("BodyVelocity",HumanoidRP)
  129. local BG = Instance.new("BodyGyro",HumanoidRP)
  130. BG.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  131. BG.D = 5000
  132. BG.P = 50000
  133. BG.CFrame = game.Workspace.CurrentCamera.CFrame
  134. BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  135. end)
  136.  
  137. W.Name = "W"
  138. W.Parent = ScreenGui
  139. W.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  140. W.Position = UDim2.new(0.161668837, 0, 0.601604283, 0)
  141. W.Size = UDim2.new(0, 58, 0, 50)
  142. W.Font = Enum.Font.SourceSans
  143. W.Text = "↑"
  144. W.TextColor3 = Color3.fromRGB(226, 226, 226)
  145. W.TextScaled = true
  146. W.TextSize = 5.000
  147. W.TextWrapped = true
  148. W.MouseButton1Down:Connect(function()
  149. HumanoidRP.Anchored = false
  150. HumanoidRP:FindFirstChildOfClass("BodyVelocity"):Destroy()
  151. HumanoidRP:FindFirstChildOfClass("BodyGyro"):Destroy()
  152. wait(.1)
  153. local BV = Instance.new("BodyVelocity",HumanoidRP)
  154. local BG = Instance.new("BodyGyro",HumanoidRP)
  155. BG.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  156. BG.D = 5000
  157. BG.P = 50000
  158. BG.CFrame = game.Workspace.CurrentCamera.CFrame
  159. BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  160. BV.Velocity = game.Workspace.CurrentCamera.CFrame.LookVector * Speed
  161. end)
  162.  
  163.  
  164. S.Name = "S"
  165. S.Parent = ScreenGui
  166. S.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  167. S.Position = UDim2.new(0.161668837, 0, 0.735294104, 0)
  168. S.Size = UDim2.new(0, 58, 0, 50)
  169. S.Font = Enum.Font.SourceSans
  170. S.Text = "↓"
  171. S.TextColor3 = Color3.fromRGB(255, 255, 255)
  172. S.TextScaled = true
  173. S.TextSize = 14.000
  174. S.TextWrapped = true
  175. S.MouseButton1Down:Connect(function()
  176. HumanoidRP.Anchored = false
  177. HumanoidRP:FindFirstChildOfClass("BodyVelocity"):Destroy()
  178. HumanoidRP:FindFirstChildOfClass("BodyGyro"):Destroy()
  179. wait(.1)
  180. local BV = Instance.new("BodyVelocity",HumanoidRP)
  181. local BG = Instance.new("BodyGyro",HumanoidRP)
  182. BG.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  183. BG.D = 5000
  184. BG.P = 50000
  185. BG.CFrame = game.Workspace.CurrentCamera.CFrame
  186. BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  187. BV.Velocity = game.Workspace.CurrentCamera.CFrame.LookVector * -Speed
  188. end)
Advertisement
Add Comment
Please, Sign In to add comment