Advertisement
Guest User

Rizz slow motion

a guest
Sep 7th, 2024
1,331
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | Gaming | 0 0
  1. local player = game.Players.LocalPlayer
  2. local humanoid = player.Character:WaitForChild("Humanoid")
  3. local isSlowMotion = false -- Tracks the slow-motion state
  4. local slowMotionSpeed = 0.3 -- Adjust this value to control the slow speed
  5. local normalSpeed = 1 -- The default playback speed for emotes
  6.  
  7. -- Button setup (Assume a TextButton named "ToggleButton" exists in a ScreenGui)
  8. local toggleButton = script.Parent:WaitForChild("ToggleButton")
  9.  
  10. -- Function to toggle slow motion
  11. local function toggleSlowMotion()
  12. isSlowMotion = not isSlowMotion
  13.  
  14. -- Loop through all animations being played on the humanoid
  15. for _, track in pairs(humanoid:GetPlayingAnimationTracks()) do
  16. if isSlowMotion then
  17. track:AdjustSpeed(slowMotionSpeed) -- Slow down the emote
  18. else
  19. track:AdjustSpeed(normalSpeed) -- Return to normal speed
  20. end
  21. end
  22.  
  23. -- Update button text to reflect current state
  24. if isSlowMotion then
  25. toggleButton.Text = "Turn Off rizz Motion"
  26. else
  27. toggleButton.Text = "Turn On rizz Motion"
  28. end
  29. end
  30.  
  31. -- Connect the button click to the toggle function
  32. toggleButton.MouseButton1Click:Connect(toggleSlowMotion)
  33.  
  34. -- Optional: Listen for when new animations are played and adjust speed accordingly
  35. humanoid.AnimationPlayed:Connect(function(animationTrack)
  36. if isSlowMotion then
  37. animationTrack:AdjustSpeed(slowMotionSpeed)
  38. end
  39. end)
  40.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement