ClickDetector dont work for the second time i click

I know this is strange but i… I just can’t figure it out alright?

  1. What do you want to achieve?
    Once click on the clickdetector, then a GUI pops up

  2. What is the issue?
    So basically… My GUI popped up for the first time but when I click it again (When the GUI is already not visible) The GUI never pop up again
    Yeah, I know this is strange. I will put my script here:

    image
    DEBUG INFO: First Time Clicking
    image
    DEBUG INFO: Second Time Clicking
    image
    The GUI didn’t pop up in the Second Time Clicking

1 Like

Are you turning the GUI visible serverside and invisible clientside? if so, the server still thinks it is visible since the client has made it invisible and that does not replicate to the server.

I would either turn the GUI visible and invisible ONLY serverside or ONLY clientside.

1 Like

i placed the Script and it is a script as a child for the ClickDetector itself
So should i try the way that the Developer hub mentioned in the “StarterPlayerScript”?

2 Likes

Could you provide some code where you are turning the GUI invisible?

1 Like

image
There

2 Likes

There it is, you are turning the GUI invisible (in your case script.Parent.Parent.Parent.Enabled = false) via a localscript. so this is done locally. The server will still think the GUI is visible because this is not replicated to the server.

A possible solution would be sending a remote event to the server asking to turn the GUI invisible via the server, but this is not a very efficient manner of handling the GUIS. I recommend turning the GUI visible and invisible only via a localscript, since GUIS are clientsided already.

1 Like

Thank you! I have put the script as a LocalScript located in StarterPlayerScript, and it worked perfectly fine!!! thanks!

2 Likes