It does not show any output whatsoever
Here's the UPDATED script
local UIS = game:GetService('UserInputService') local plr = game.Players.LocalPlayer local Char = plr.Character or plr.CharacterAdded:wait() local Key = 'E' --Make sure to capitalize it! local animation = Instance.new("Animation") animation.AnimationId = 'rbxassetid://2456539535' --The is the appropriate format local debounce = true UIS.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key]and debounce then debounce = false local LoadAnimation = Char.Humanoid:LoadAnimation("Animation") LoadAnimation:Play() wait(2) debounce = true end end)
Alright, so I have spotted two issues with the script.
On line 5, you are calling Key to be equal to 'e'. However, as far as I'm aware, UIS keycodes go by the capital letter, so just make a mental note to be aware of that.
As well as that, on line 8, the formatting for the animation is incorrect. Roblox's format this is rbxassetid://[InsertCodeHere]. So it should be replaced with rbxassetid://2456539535.
local UIS = game:GetService('UserInputService') local plr = game.Players.LocalPlayer local Char = plr.Character or plr.CharacterAdded:wait() local Key = 'E' --Make sure to capitalize it! local animation = Instance.new("Animation") animation.AnimationID = 'rbxassetid://2456539535' --The is the appropriate format local Debounce = true UIS.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key]and debounce then Debounce = false local LoadAnimation =Char.Humanoid:LoadAnimation(Animation) LoadAnimation:Play() wait(2) Debounce = true end end)
All in all, just make sure you have that E capitalized and have the right format for animations. (That format is the same for decals, images, etc.)
Your error on line 15 after "debounce" you missed "true", so type this on that line
if KeyPressed == Enum.KeyCode[Key]and debounce == true then