How to fix animationclipprovider

i cant seem how to fix it i need it for my battlegrounds game

1 Like
2 Likes

i tried it myself the error still happens

Can you provide a snippet of your code so we can see if there are any issues?

this is the local script there is also a server script but that doesnt have animation code

local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftPunch = animator:LoadAnimation(script:WaitForChild("LeftPunch"))
local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))

local currentPunch = 0
local lastPunch = 0

local debounce = false

local function punch()
	if debounce then return end
	if tick() - lastPunch > 1.5 then
		currentPunch = 0
	end

	debounce = true
	if currentPunch == 0 then
		rightPunch:Play()
		hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3, 0)
		task.wait(0.4)
		debounce = false
	elseif currentPunch == 1 then
		leftPunch:Play()
		hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3, 0)
		task.wait(0.4)
		debounce = false
	elseif currentPunch == 2 then
		rightPunch:Play()
		hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3, 100)
		task.wait(0.8)
		debounce = false
	end
	if currentPunch == 2 then
		currentPunch = 0
	else
		currentPunch += 1
	end
	lastPunch = tick()
end

cas:BindAction("Punch", punch, true, Enum.UserInputType.MouseButton1)

did u find any errors causing the issue?

Tested the script myself and I don’t have any issues.
Can you show the error message?

1 Like

does the animation load for u?

I used a replacement animation and yes it loads.
I think the problem in your case is that when you load the animation, the character hasn’t been fully loaded yet which results in the error.

This error also happens if the character isn’t under workspace.

Additional note: I put the LocalScript inside StarterCharacterScripts instead of StarterPlayerScripts, so the script loads after the character is added. Maybe this could help your case
image

1 Like

i tried it it still doesnt load

i took the punching thing from youtube and the guy told me to put a screengui called Main, in starterGUI and put the punch script in that

@thom463s i just dont know why it doesnt load

I can’t really reproduce your issue sadly so I’m not sure why it isn’t loading for you.

i mean like before it was working and just yesterday night the error started coming and i didnt change the scripts at all

@thom463s everytime i try to make a game theres always that one bug that makes me not fail the game i guess im not meant to make games