I'm making something that randomizes animations, between LeftPunch, and RightPunch. The error listed in the title is what happens when I play it.
Code:
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local deb = false -- our debounce
local animation = Instance.new("Animation")
animation.AnimationId = Random.new("4958723922", "4958704831")
local track = character:FindFirstChild("Humanoid"):LoadAnimation(animation)
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, proc)
if not proc then -- So that it wont fire when the player is chatting
if input.KeyCode == Enum.KeyCode.F and deb == false then
deb = true
track:Play()
wait(1)
deb = false
end
end
end)
