#Animation stopping when item is destroyed.

1 messages · Page 1 of 1 (latest)

gray seal
#

So I have this tool, a trash bag and it has a holding animation and when i hold e at the trash can it destroys the tool and gives you money, the issue that i got is that when the tool is destroyed, the animation doesn't stop and it stays there.

true hedge
#

Would assume its because the script gets destroyed as well

gray seal
#

What should I do then

#

In the description of the .Destroying it says that it fires a right before it gets destroyed

true hedge
#

yeah but it doesn't work when the script is a child of the instance being destroyed

#

Roblox does something funky to get around this in their racing template

#

They create a script that listens for destroying outside the part and then fires a bindable event when it gets destroyed

#

But if u want a very easy fix then I think u can just go into Workspace and change SignalBehavior from Deferred to Immediate

#

And I think would fix

true hedge
#

Could

gray seal
true hedge
#

That don’t make sense

gray seal
#

this is with immediate

#

this is with deferred

true hedge
#

Guess could look at what Roblox does in their Racing template

#

But yeah idealy you don't want to put scripts inside instances of course

gray seal
#

Any idea what this could be

true hedge
#

Could be because its a tool I guess

gray seal
#

So i changed everything and now i got a script for everything and basically every works normally but stopping the animation doesnt, and when i delete the tool an error pops up. The error doesnt pop up when i delete other items like another script that i got i delete an item but it works normally

true hedge
#

Trashbag is archivable?

gray seal
#

ηθη

#

huh

gray seal
true hedge
#

Don't think it would throw that error but only idea I had

#

I guess its just to stop cloning tho

gray seal
#

but i need to clone it

#

and it is archivable

true hedge
#

when its false it means it cant be cloned

#

Its not the issue

gray seal
true hedge
#

I don't understand why this is happening

gray seal
#

me neither

#

this is my other script where i destroy a tool again

#

and it works fine

true hedge
#

When I delete a tool it doesn't give me that error

#

Cuz I have this but works fine

#

I assumed ur handling it on client

#

and it handles the destroying event fine

#

But this script is not a child of the tool

gray seal
#

Nope it's a script in server script service

true hedge
#

Also

#

Tools are in the Backpack when Unequipped and in the Character when equipped

gray seal
#

Ik

#

I have it so it equips when you unequip it so it's always ewuiped

true hedge
#

And u making the tool on the server too?

#

Yeah I don't know

gray seal
#

yep

#

its all handled in a script is sss

#

im cookedFeelsSadMan

true hedge
#

Well yeah when I tried that I still couldn't get the issue

#

The only time I've gotten warning like that is when trying to delete a service