Unsure how to stop tool idle animation [SOLVED]

Hello. I’m creating a tool that contains a idle animation, everything works fine but there is one issue that I have with it.

The way the tool works is that when activated through a client script, it will fire a remote event to the server where it would check if the hitbox has touched something, it it has and it’s a player, then it would take damage to the player and the tool will be deleted afterwards.

The issue comes when the idle animation for the tool still plays after the tool has been destroyed, and I’m not able to stop it because of the way the tool works as I don’t have any access to it on the server script nor can I send it through the remote event. I only have access to it on the equipped function in the client script, here’s a picture of it:

image

How would I go about stopping the idle animation? I will answer any questions if asked, any help is appreciated!

3 Likes

Hey! I had this issue a while ago. My issue was the priority of the animation, I’ve just linked a roblox documentation post to it.

Ensure that the priority is idle. Hopefully this helps, reply if it doesn’t.

1 Like

In your code, just add:

AnimationTrack.AnimationPriority = Enum.AnimationPriority.Idle
1 Like

The main problem is definitely the animation priority. Set it to “Idle” and it’ll work fine

Uh I think you and others misunderstood the issue. I already have my animation priority set to idle, that’s not the issue. The issue is that I’m unsure on how to stop the idle animation from playing after the tool is deleted as I don’t have any access of it expect through the equipped function which I showed in the post.

Please read my previous reply.

Please read the previous reply.

You never even said that you already have animation priority set to idle, which is exactly why we all said that. The issue probably comes from the script itself.

If you want the idle animation to stop after the tool has been deleted, then simply do

script.Parent.Removing:Connect(function()
AnimationTrack:Stop()
end)

Deleting the tool from the player’s inventory (or simply setting it’s parent to nil) does not mean unequipping.

Sorry I’ve should’ve stated that. And I know that setting its parent to nil doesn’t mean unequipping, I never said I thought it did. Also where would I put this function? because I’ve stated that I can only access this function on the equipped function that I showed above as that’s where the idle animation is played on. I don’t have access to it on the activated function, and I don’t have access to it in the server.

I think (and may be wrong) that the solution is spawning in a rig in studio, finding the animation script, dragging it to starterplayerscripts, and deleting the tool animation part

Uh no that wouldn’t work as I’m not touching the animation script in the player, this animation is being played through the tool.

So you want to keep the default tool animation?

No, I want to stop the tool idle animation, but as I said before, I don’t have any access of it expect through the equipped function. When you activate this tool it runs a remoteevent to the server. If the tool has touched a player while activated then it will deal damage to the player and delete itself. I’m not able to stop the players tool idle animation in the server and the server is also where it completely gets rid of the tool. So I’m asking how do I stop this animation when I can’t access it through the server script and tool.activated function? I can only access it on the tool.Equipped function.

Try making a reference tool in replicated storage and deleting the tool instead of unequipping it.

Can you explain a bit more on what you mean by this?

Are you trying to delete the tool from the player’s inventory or just unequip it?

I’m deleting the players tool from their inventory.

I think you should add script.Parent:Destroy() at the end of the event

That would just destroy the tool once the player unequips it. On top of that this is on client so it would only destroy on client. The tool gets destroyed once the player hits another player with it.