this is the script, it says loadanimation requires an object
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local debounce = false
local damage = 10
local animi = script.Parent.Punch
local anim = humanoid:LoadAnimation(animi)
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local punchevent = remotes:WaitForChild("Punch")
uis.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.F and not gameProcessed then
if debounce == false then
debounce = true
local punchanim = humanoid:LoadAnimation(animi(character))
punchevent:FireServer()
wait(3)
debounce = false
end
end
end)
It needs an object with the “Animation” class name, assuming that you have that object in animi, so try and do local punchanim = humanoid:LoadAnimation(animi)
Have you tried adding punchanim:Play() after loading? In addition, you should consider using AnimationController instead of directly putting into the Humanoid has Roblox has deprecated that method.
Well, an object is from an instance. You will let me help you or you will continue to experience the issue. Can you screenshot the instance (also know as the icon which tells the classification of the object)?