Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get the Player's Character and Humanoid
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- -- Create the Animation and Sound
- local animationId = "rbxassetid://16944345619" -- Replace with your animation ID
- local soundId = "rbxassetid://16944654440" -- Replace with your sound ID
- -- Load Animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Play Animation
- animationTrack:Play()
- -- Create Sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character
- sound:Play()
- -- Optional: Clean up sound after it finishes
- sound.Ended:Connect(function()
- sound:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement