For some reason my UserInputService is working. I have it set up to where if a certain key was pressed, E, an animation would be loaded into the character and the animation would play. After a few failed attempts, I tried a print function, but turns out that doesn't work either. The entire thing doesn't even run when the button is pressed.
The code is simple, just a few lines, which is in a LocalScript which is in the StarterPlayerScript. I have also tested it in StarterGui but that didn't work either.
`local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character
uis.InputBegan:Connect(function(input)
if input == Enum.KeyCode.E then
local smash = Instance.new("Animation")
smash.AnimationId = 'rbxassetid://2941877623'
local usos = char.Humanoid:LoadAnimation(smash)
usos:Play()
end
end)`
Your script is correct, just make sure that it is a LocalScript and put it in the StarterGUI. Do try and tell me if it works or not.