Why does my animation only work in Studio?

I have a tool that plays an animation when clicked, but upon testing in game, it doesn’t work.

In game:

In studio:

Tool Script:

local tool = script.Parent
local anim = tool:WaitForChild('Animation')

local Players = game:GetService("Players")
local player
local canhit = true

local function onEquipped()
	local char = tool.Parent
	player = Players:GetPlayerFromCharacter(char)
end

tool.Activated:Connect(function()
	if canhit == true then
		canhit = false
	local Character = tool.Parent
	local Humanoid = Character:FindFirstChildOfClass("Humanoid")
	local Animator = Humanoid:FindFirstChildOfClass("Animator")
	local leaderstats = player:WaitForChild("leaderstats")
	local strength = leaderstats:WaitForChild("Strength")

	local AnimationTrack = Animator:LoadAnimation(anim)
	AnimationTrack:Play()
	strength.Value += 100
		task.wait(0.8)
		canhit = true
		end
end)

tool.Equipped:Connect(onEquipped)

If you look at the video, you’ll see that in game, the strength goes up. But the animation only works in the studio video
Any help would be appreciated, thanks!

1 Like

the creator of the animation needs to be made by the game owner, if your the game owner, make yourself the creator of the animation, if a group made the game, set the creator of the animaton to the group, if someone else is the owner, tell him to create the animation and give you the ID.

4 Likes

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