Function stopping problem

I have this remote event that fires to the client when the player does something, it’s supposed to play a tween and make the gui invisible after the tween. The problem is that when the player does the thing really fast the old function makes the new tween invisible while its still playing.

I could add a debounce, but I want it to happend fast and cancel out the other function.

Are you able to provide the code you are using, both to make it visible and to make it invisible?

You could store the tween in a variable, then before you make the new tween, check if the variable already is an existing tween. If it is, just call :Destroy() on it.

Without more information, we can’t help you.
I’d suggest using Tween.Completed:wait()

I already found a solutiong myself, but i don’t know how to close a topic though.

I wouldn’t advice that, as it means other people won’t know how to solve it.


@pasje1312, you should type out the solution you ended up finding, and posting it as a reply to your own post. Then, click the box with a tick in it (i think that’s what the icon is??) to mark your reply as the solution.

This is the solution I found:

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