Why is this happening? (SurfaceGui Script)

I can’t seem to find any problem with the script.

My theory is that:

  1. Another visible UI is overlapping the Functions frame, thus not showing it.
  2. The Functions frame remains not visible.

While playing the game, check each of the UI’s property to see any unusual values.

There is nothing overlapping, the issue is that the frame doesn’t tween at all.

Hmm…

Try passing another argument to the TweenPosition function and setting it to true.

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.

Although I do suggest using TweenService for the ImageTransparency, I don’t think the use of wait is the issue. Because it works the first time.

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.

It’s not because of the wait, I tried getting rid of the waits and the issue still stands.

This becomes:

Functions:TweenPosition(UDim2.new(0, 0, 0, 0),"Out","Quart",0.5,true)

This becomes:

Functions:TweenPosition(UDim2.new(0, -150, 0, 0),"Out","Quart",0.5,true)

Still doesn’t work, the frame position still doesn’t change.

On the main script, for experimental purposes, try getting rid of the tween and just setting the position. I want to see if that works.

Can you try changing all the waits with a Tween?

Using TweenService, tween the ImageTransparency property from 0 to 1 (and vice versa).

He tried getting rid of the waits and the same issue persisted. It doesn’t have anything to do with the waits.

Same issue. It works the first time, not the second.

Another possibility is that this is a studio bug. Try this in-game and see if maybe it works.

Nope, it doesn’t work in game either.

I just noticed this, but why are you using a server script for tweening (entering)? It is recommended to tween GUIs using local script. It may not be related to your issue, but maybe switch to a local script?

Have you tried this? It could have something to do with TweenService

Yes, I tried it and the same issue happened. It worked the first time, not the second.

Ohh you might be right. It seems like he is tweening the frame IN with a serverscript but tweening it OUT with a localscript

Oh I think I know why now. It’s because of how two different unique script controls the UI.

In the server, you tweened the Functions frame to the position (0, 150, 0 ,0) which would replicate to all clients to change their UI.

In the client, you tweened the Functions frame back to the original position (0, 0, 0, 0), but the server sees that it is not in the position (0, 0, 0, 0).

The reason why it doesn’t tween the second time is because the server sees that the Functions frame is not back to its position (0, 0, 0, 0), so it doesn’t tell the client to change anything.