Animations not working in tools

Or did it work right away???

prompt got Triggered! - 클라이언트 - ThisScript:28
23:04:25.275 lock is false, continue - 클라이언트 - ThisScript:32
23:04:25.275 continue - 클라이언트 - ThisScript:46
23:04:25.275 continue - 클라이언트 - ThisScript:56
23:04:25.275 fire - 클라이언트 - ThisScript:62
23:04:25.275 요청 보냄 - 클라이언트 - ThisScript:66
23:04:25.326 spill = SpillPart and player = xptmxmgkfj - 클라이언트 - LocalScript:7
23:04:25.328 Event Called! - 클라이언트 - LocalScript:8
23:04:25.328 Character = xptmxmgkfj AND humanoid = Humanoid - 클라이언트 - LocalScript:11
23:04:25.330 Loaded Animator! - 클라이언트 - LocalScript:18
23:04:25.330 PLAY!!! - 클라이언트 - LocalScript:23
23:04:28.344 STOP!!! - 클라이언트 - LocalScript:27

The log is displayed properly, but why can’t the animation be played to the player?

Animation doesn’t seem to work in local scripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local eventClean = ReplicatedStorage:WaitForChild("eventclean")
warn('loaded "EventClean_event" =', eventClean)
eventClean.OnClientEvent:Connect(function(spill, player)	
	warn('spill =', spill, 'and player =', player)
	warn('Event Called!')
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	warn('Character =', character, "AND humanoid =", humanoid)

	local animator = humanoid:FindFirstChildOfClass("Animator")

	local tool = script.Parent

	if animator then
		warn('Loaded Animator!')
		local anim = Instance.new("Animation")
		anim.AnimationId = "rbxassetid://79961298705140"
		local animationTrack = animator:LoadAnimation(anim)
		animationTrack:Play()
		warn('PLAY!!!!')

		task.delay(3, function()
			if animationTrack then
				warn('STOP!!!')
				animationTrack:Stop()
			end
		end)
	end
end)

Is localscript

alr, try:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local eventClean = ReplicatedStorage:WaitForChild("eventclean")
warn('loaded "EventClean_event" =', eventClean)
eventClean.OnClientEvent:Connect(function(spill, player)	
	warn('spill =', spill, 'and player =', player)
	warn('Event Called!')
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	warn('Character =', character, "AND humanoid =", humanoid)

	local animator = humanoid:FindFirstChildOfClass("Animator")

	local tool = script.Parent

	if animator then
		warn('Loaded Animator!')
		local anim = Instance.new("Animation")
		anim.AnimationId = "rbxassetid://79961298705140"
		local animationTrack = animator:LoadAnimation(anim)
		animationTrack:Play()
		warn('PLAY!!!!')
	end
end)

if this doesn’t work, I will do something different, please wait until I do so

did this work or not?
//////////////////////////

Can you please give me an update?

09:18:14.681 loaded “EventClean_event” = eventclean - 클라이언트 - LocalScript:5
09:18:14.722 console - 클라이언트 - PlayerDeviceDetect:25
09:18:15.194 :arrow_forward: 2 (x2) - 서버 - Spills:60
09:18:18.976 prompt got Triggered! - 클라이언트 - ThisScript:28
09:18:18.976 lock is false, continue - 클라이언트 - ThisScript:32
09:18:18.976 continue - 클라이언트 - ThisScript:46
09:18:18.976 continue - 클라이언트 - ThisScript:56
09:18:18.977 fire - 클라이언트 - ThisScript:62
09:18:18.977 요청 보냄 - 클라이언트 - ThisScript:66
09:18:19.013 spill = SpillPart and player = xptmxmgkfj - 클라이언트 - LocalScript:7
09:18:19.015 Event Called! - 클라이언트 - LocalScript:8
09:18:19.015 Character = xptmxmgkfj AND humanoid = Humanoid - 클라이언트 - LocalScript:11
09:18:19.017 Loaded Animator! - 클라이언트 - LocalScript:18
09:18:19.017 PLAY!!! - 클라이언트 - LocalScript:23

Not working

Is bug?

This animation is correct, but why does the animation play after pressing E and everything is cleaned?

This is kind of impossible, the “Play” got printed, but the animation didn’t play?!?!?!
Make sure that you animated the animation correctly, then try this:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local eventClean = ReplicatedStorage:WaitForChild("eventclean")
warn('loaded "EventClean_event" =', eventClean)
eventClean.OnClientEvent:Connect(function(spill, player)	
	warn('spill =', spill, 'and player =', player)
	warn('Event Called!')
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	warn('Character =', character, "AND humanoid =", humanoid)

	local animator = humanoid:FindFirstChildOfClass("Animator")

	local tool = script.Parent

	if animator then
		warn('Loaded Animator!')
		local anim = Instance.new("Animation")
		anim.AnimationId = "rbxassetid://126407570972225"
        anim.Parnet = Player.Character
		local animationTrack = animator:LoadAnimation(anim)
		animationTrack:Play()
		warn('PLAY!!!!')
	end
end)

Now, did this work?
If not, send me the logs