When player dies, problem occurs

So…

This is my 2nd post about my problem maybe this will reach more people but, I have an issue with when a player dies with this tool the animations… Everything, kind of breaks down, and I’m trying to find out the issue so it can work properly.

(error)

LocalScript:20: Cannot load the AnimationClipProvider Service.

Here is the server:

local tool = script.Parent.Parent.Parent

local replicatedStorage = game:GetService("ReplicatedStorage")
local kiwiEngine = replicatedStorage["Kiwi Engine"]

local firePoint = tool.FirePoint

local ShootEvent = script.Parent.Parent["(Local)"]:WaitForChild("Shoot")
local DamageEvent = script.Parent.Parent["(Local)"]:WaitForChild("Damage")

local Effects = firePoint.Effects
local SFX = Effects.SFX

local range = 300

local damageAmount = tool.Configs.GunComponents.Damage.Value

tool.Activated:Connect(function()
	if tool.Configs.Accessories["Shells?"].Value == true then
		local shellCasing = kiwiEngine["ShellCasting(Pistol)"]:Clone()	
		shellCasing.Parent = workspace
		shellCasing.CFrame = CFrame.new(firePoint.Casing.WorldPosition) * CFrame.new(-.2, 0, 0)

		task.wait(10)
		shellCasing:Destroy()
	end
end)

ShootEvent.OnServerEvent:Connect(function(player, mouseHit)
	
	SFX.Fire:Play()
	Effects.MuzzleEffect.Enabled = true
	Effects.MuzzleFlash.Enabled = true
	task.wait(0.05)
	Effects.MuzzleEffect.Enabled = false
	Effects.MuzzleFlash.Enabled = false
	
	if player.Name == tool.Parent.Name then
		local filterType = Enum.RaycastFilterType.Exclude
		local filter = RaycastParams.new()
		filter.FilterType = filterType
		filter.FilterDescendantsInstances = {tool.Parent}
		local raycast = workspace:Raycast(firePoint.Position, (mouseHit - firePoint.Position).Unit * range, filter )
		if raycast then
			local hitPart = raycast.Instance
			print(hitPart.Name)
			local char = hitPart.Parent
			local hum = char:FindFirstChild("Humanoid")
			if char.Name ~= tool.Parent.Name and hum then
				hum:TakeDamage(damageAmount)
				DamageEvent:FireClient(player)
			elseif hitPart.Name == 'Head' and char.Name ~= tool.Parent.Name and hum then
				print("headshot")
				hum:TakeDamage(damageAmount * 3.5)
				DamageEvent:FireClient(player)
			end
		end
	end
end)

and the local . . .

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local mouse = player:GetMouse()

local DamageEvent = script.Parent.Parent["(Local)"]:WaitForChild("Damage")
local tool = script.Parent.Parent.Parent

local equipped = false

local IdleAnimId = Instance.new("Animation")
IdleAnimId.AnimationId = tool.Animations.IdleAnim.AnimationId

local ShootAnimId = Instance.new("Animation")
ShootAnimId.AnimationId = tool.Animations.ShootAnim.AnimationId

game:GetService('RunService').Stepped:Wait()

local IdleAnimation = humanoid:LoadAnimation(IdleAnimId)
local ShootAnimation = humanoid:LoadAnimation(ShootAnimId)

local SFX = tool.FirePoint.Effects.SFX

tool.Equipped:Connect(function()
	local holder = tool.Parent
	IdleAnimation:Play()
	if holder.Name == player.Name then
		equipped = true
		else
		equipped = false
	end
end)

tool.Unequipped:Connect(function()
	game:GetService('RunService').Stepped:Wait()
	IdleAnimation:Stop()
	local holder = tool.Parent
	if holder.Name == player.Name then
		equipped = true
	else
		equipped = false
	end
end)

mouse.Button1Down:Connect(function()
	if equipped then
		script.Parent.Shoot:FireServer(mouse.Hit.p)
		ShootAnimation:Play()
	end
end)

DamageEvent.OnClientEvent:Connect(function()
	SFX.Hitmarker:Play()
end)

Forgot the most important part, the ErR0r

And if you want to test it, and help me find put the problem…

Here is the link to the [weapon]:

https://tinyurl.com/rblxgun

Not sure on this one I’ve never seen this error before, found a similar post that might provide some help

Thank you so much your are the best, as well as thanks to @BuilderBird_Dev :smiley:

1 Like

Actually had this issue occur to me a bit after I responded, if you have a model that isn’t parented to anything (more specifically workspace) then this error will be thrown at you if you try to load animations on it

Yeah, but mine was parented and other stuff so idk :man_shrugging:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.