Hi, I’m trying to create a script that repeats something everytime a button is clicked on.
As you can see in the video, the script works perfectly the fine the first time it’s ran. However, the second time, the ‘Functions’ frame doesn’t get tweened. Why is this happening and how can I fix it?
My script is not a LocalScript, it’s a server script. My problem is also not the same. The first time the script is ran, it works fine. Any more times, everything works except the frame tweening.
One suggestion on a way to do this is by making a clone of the SurfaceGui before starting the animations, then deleting the SurfaceGui and replacing it with the clone once the animation is over.
This is unrelated, but don’t use wait(0.01) if you’re wanting the Image to disappear for a certain amount of time, either use RunService.Stepped or Tween it using TweenService
It doesn’t look like you’re changing back the properties of the ImageTransparency & Visible back to their original states (At least provided inside the script you gave us), you could try printing what their properties are supposed to be?
It seems like you only provided us the script when the frame enters. Can you provide us with the script when you exit? There could be something when you exit the frame.
Yeah, I have noticed that on the second you clicked, the Position property of the Functions frame didn’t change. It seems like the method TweenPosition didn’t register at all.
The problem might be you have too many wait. I would suggest tweening the ImageTransparency using TweenService.
Sorry, what changes should I make and where should I make them exactly? Not sure what much of this means, I have very little experience with programming.