I’m looking to make a tool script but I can’t make the animation move. I’ve tried to use an animation instance and an animation in the workspace to make it work. I think the error might have to do something with the player.Humanoid
local UIS = game:GetService("UserInputService")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://15046928442"
game.Players.LocalPlayer.Backpack.Flashlight.Equipped:Connect(function(player)
print("Equipped!")
local track = player.Humanoid:LoadAnimation(anim)
track:Play()
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
script.Parent.Light.SpotLight.Brightness = 5
end
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
script.Parent.Light.SpotLight.Brightness = 0
end
end)