Advertisement
ILovePotato

Untitled

Jan 22nd, 2025
25,224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. -- Configuration
  2. local animationId = "rbxassetid://17325160621" -- Replace with your animation's ID
  3. local soundId = "rbxassetid://17325174223" -- Replace with your sound's ID
  4.  
  5. -- Setup
  6. local player = game.Players.LocalPlayer
  7. local character = player.Character or player.CharacterAdded:Wait()
  8. local humanoid = character:FindFirstChildOfClass("Humanoid")
  9.  
  10. if not humanoid then
  11. warn("Humanoid not found!")
  12. return
  13. end
  14.  
  15. -- Load Animation
  16. local animation = Instance.new("Animation")
  17. animation.AnimationId = animationId
  18. local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
  19. local animationTrack = animator:LoadAnimation(animation)
  20.  
  21. -- Play Animation
  22. animationTrack.Looped = false
  23. animationTrack:Play()
  24.  
  25. -- Play Sound
  26. local sound = Instance.new("Sound")
  27. sound.SoundId = soundId
  28. sound.Volume = 1 -- Adjust volume if needed
  29. sound.Parent = character.Head or character.PrimaryPart
  30. sound:Play()
  31.  
  32. -- Clean up after sound ends
  33. sound.Ended:Connect(function()
  34. sound:Destroy()
  35. end)
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement