I'm extremely new to lua, and I am very bad at it. That being said, my current code is meant to play an animation for the player when a keybind (E) is pressed. However, it does nothing. Here's the code: local UserInputService = game:GetService("UserInputService")
local Animation = script.Animation
UserInputService.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
print("O")
local Anim = Humanoid:LoadAnimation(Animation)
print("X")
Anim:Play()
end
end)
** You are now Level 1! **