It's a self killing script. It goes like this:
local UIS = game:GetService('UserInputService') local plr = game.Players.LocalPlayer local Char = plr.Character or plr.CharacterAdded:Wait() local Key = 'R' local Animation = Instance.new("Animation") Animation.AnimationId = 'rbxassetid://3690421923' UIS.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key] then Debounce = false local LoadAnimation = Char.Humanoid:LoadAnimation(Animation) LoadAnimation:Play() wait(1.24) Player = game.Players.LocalPlayer.Character.Head Player:Destroy() Debounce = true end end)
I need to make a sound after the wait(1.24) command
You could put a sound in playergui and just make it play
local UIS = game:GetService('UserInputService') local plr = game.Players.LocalPlayer local Char = plr.Character or plr.CharacterAdded:Wait() local Key = 'R' local Animation = Instance.new("Animation") Animation.AnimationId = 'rbxassetid://3690421923' UIS.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key] then Debounce = false local LoadAnimation = Char.Humanoid:LoadAnimation(Animation) LoadAnimation:Play() wait(1.24) plr.PlayerGui.Sound:Play() Player = game.Players.LocalPlayer.Character.Head Player:Destroy() Debounce = true end end)