Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Configuration
- local animationId = "rbxassetid://17325160621" -- Replace with your animation's ID
- local soundId = "rbxassetid://17325174223" -- Replace with your sound's ID
- -- Setup
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- warn("Humanoid not found!")
- return
- end
- -- Load Animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
- local animationTrack = animator:LoadAnimation(animation)
- -- Play Animation
- animationTrack.Looped = false
- animationTrack:Play()
- -- Play Sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Volume = 1 -- Adjust volume if needed
- sound.Parent = character.Head or character.PrimaryPart
- sound:Play()
- -- Clean up after sound ends
- sound.Ended:Connect(function()
- sound:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement