Advertisement
ILovePotato

Untitled

Jan 22nd, 2025
20,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. -- Replace these with your actual animation ID and sound ID
  2. local animationId = "rbxassetid://18445236460"
  3. local soundId = "rbxassetid://18445228136"
  4.  
  5. -- Get the player's character
  6. local player = game.Players.LocalPlayer
  7. local character = player.Character or player.CharacterAdded:Wait()
  8.  
  9. -- Play the animation
  10. local humanoid = character:WaitForChild("Humanoid")
  11. local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
  12.  
  13. local animation = Instance.new("Animation")
  14. animation.AnimationId = animationId
  15. local animationTrack = animator:LoadAnimation(animation)
  16. animationTrack:Play()
  17.  
  18. -- Play the sound
  19. local sound = Instance.new("Sound")
  20. sound.SoundId = soundId
  21. sound.Parent = character:WaitForChild("HumanoidRootPart")
  22. sound:Play()
  23.  
  24. -- Wait for the animation and sound to finish
  25. animationTrack.Stopped:Wait()
  26. sound.Ended:Wait()
  27.  
  28. -- Cleanup sound after playback
  29. sound:Destroy()
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement