Advertisement
MaxproGlitcher

hamster_ball script by Max .lua

Mar 6th, 2023
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. game:GetService("StarterGui"):SetCore("SendNotification",{
  2. Title = "Script hamster_ball",
  3. Text = "Script a été executer",
  4. Icon = "rbxassetid://11823384169",
  5. Duration = 15
  6. })
  7.  
  8. --[[By MaxproGlitcher Discord:MaxproGlitcher#6199
  9. _____ ________.__ .__ __ .__
  10. / \ _____ ___ ________________ ____ / _____/| | |__|/ |_ ____ | |__ ___________
  11. / \ / \\__ \ \ \/ /\____ \_ __ \/ _ \/ \ ___| | | \ __\/ ___\| | \_/ __ \_ __ \
  12. / Y \/ __ \_> < | |_> > | \( <_> ) \_\ \ |_| || | \ \___| Y \ ___/| | \/
  13. \____|__ (____ /__/\_ \| __/|__| \____/ \______ /____/__||__| \___ >___| /\___ >__|
  14. \/ \/ \/|__| \/ \/ \/ \/
  15.  
  16. ]]
  17.  
  18. local UserInputService = game:GetService("UserInputService")
  19. local RunService = game:GetService("RunService")
  20. local Camera = workspace.CurrentCamera
  21.  
  22. local SPEED_MULTIPLIER = 30
  23. local JUMP_POWER = 60
  24. local JUMP_GAP = 0.3
  25.  
  26. local character = game.Players.LocalPlayer.Character
  27.  
  28. for i,v in ipairs(character:GetDescendants()) do
  29. if v:IsA("BasePart") then
  30. v.CanCollide = false
  31. end
  32. end
  33.  
  34. local ball = character.HumanoidRootPart
  35. ball.Shape = Enum.PartType.Ball
  36. ball.Size = Vector3.new(5,5,5)
  37. local humanoid = character:WaitForChild("Humanoid")
  38. local params = RaycastParams.new()
  39. params.FilterType = Enum.RaycastFilterType.Blacklist
  40. params.FilterDescendantsInstances = {character}
  41.  
  42. local tc = RunService.RenderStepped:Connect(function(delta)
  43. ball.CanCollide = true
  44. humanoid.PlatformStand = true
  45. if UserInputService:GetFocusedTextBox() then return end
  46. if UserInputService:IsKeyDown("W") then
  47. ball.RotVelocity -= Camera.CFrame.RightVector * delta * SPEED_MULTIPLIER
  48. end
  49. if UserInputService:IsKeyDown("A") then
  50. ball.RotVelocity -= Camera.CFrame.LookVector * delta * SPEED_MULTIPLIER
  51. end
  52. if UserInputService:IsKeyDown("S") then
  53. ball.RotVelocity += Camera.CFrame.RightVector * delta * SPEED_MULTIPLIER
  54. end
  55. if UserInputService:IsKeyDown("D") then
  56. ball.RotVelocity += Camera.CFrame.LookVector * delta * SPEED_MULTIPLIER
  57. end
  58. --ball.RotVelocity = ball.RotVelocity - Vector3.new(0,ball.RotVelocity.Y/50,0)
  59. end)
  60.  
  61. UserInputService.JumpRequest:Connect(function()
  62. local result = workspace:Raycast(
  63. ball.Position,
  64. Vector3.new(
  65. 0,
  66. -((ball.Size.Y/2)+JUMP_GAP),
  67. 0
  68. ),
  69. params
  70. )
  71. if result then
  72. ball.Velocity = ball.Velocity + Vector3.new(0,JUMP_POWER,0)
  73. end
  74. end)
  75.  
  76. Camera.CameraSubject = ball
  77. humanoid.Died:Connect(function() tc:Disconnect() end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement