Custom tool animation only plays in Studio

I’m trying to make an animation play whenever I click with a tool in my hand.
This works in Studio, but not in the published game.
Why is this happening?

The toolbox looks like this:
image

This is inside the “Attack” local script:

script.Parent.Equipped:Connect(function()
    script.Parent.Equip:FireServer()
end)

And this is inside the normal “Attack” script inside the RemoteEvent:

local range = 3
local hitboxmodule = require(game.ReplicatedStorage.Hitboxes)

local dmgPerAttributePoint = 20
local starterDamage = 20

Enabled = true
local combo = 1

script.Parent.OnServerEvent:Connect(function(player)
	if not Enabled then return end
	local char = player.Character
	
	Enabled = false
	
	if combo == 1 then
		local Anim = script.Swing1
		local playAnim = char.Humanoid:LoadAnimation(Anim)
		playAnim:Play()
		combo = 2
	else
		local Anim = script.Swing2
		local playAnim = char.Humanoid:LoadAnimation(Anim)
		playAnim:Play()
		combo = 1
	end
	
	local targets = hitboxmodule(char,range)
	
	local dmg = starterDamage + player.Attributes.Attack.Value *dmgPerAttributePoint
	
	for i,v in pairs(targets) do
		v.Humanoid:TakeDamage(dmg)
		
		if v.Humanoid.Health <= 0 then
			v.Humanoid:Destroy()
			local expToGain = 1
			
			player.LevelsInfo.Experience.Value += expToGain
		end
	end
	
	wait(1)
	Enabled = true
end)

Thanks in advance for anyone who helps.

This has happened to me before in team create because despite the fact that I created the animation, I didn’t own the place so Roblox Studio thought the animation wasn’t made by me. So I don’t really know what to suggest other than asking if the animation is made by you?

Yup, it was made by me. I uploaded the game to my group, though

1 Like

That might have something to do with it, I’m not really sure though.

i heard you can upload animations as a group, so technically the animation’s owner is the group

As @CrazyCats84 said…

they aren’t playing as the game is owned by the group, so you’ll have to upload the animations to the group too.

Is the author of the Roblox game the group?