GUI that can only be clicked once

Hi, recently I have made this GUI that when you click it moves you to a team.


Although what I want is for that when the player clicks one of the teams they cannot click any of the other teams.
Here is an image of it in the explorer.
image
Also, the X on the GUI is for when it gets clicked it makes the Job GUI invisible.
This is the script inside of the TextButton Named Red

function Click(mouse) 
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Really red") 
end 

script.Parent.MouseButton1Click:connect(Click) 

It is the same script as the ones inside of Green and Blue just that those have a different color.
This might seem very simple but I don’t have much scripting knowledge. Also if possible could anyone explain how to make a GUI that opens the Job GUI.
Thanks.

2 Likes

Should you not just consider closing the UI when they select a team then?
Or alternatively, disable the team changer script when they’ve selected one.

Do you want it to be like when they click the button that the gui disappears, or do you still want the gui to be seen?

You can make a bool value if they can join a team. It can be true when they can and false when they can’t. You can set it to false when they click on the gui button.

You can just made it so when the person click, the whole GUI gets deleted.

local plr = game:GetService("Players").LocalPlayer

script.Parent.MouseButton1Down:Connect(function()
LocationHere:Destroy()
end

If you attempting to make it disappear once you click a button you could just do something like
local frame = script.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
frame.Visible = false
end)

When they click it make the whole entire Job GUI disappear. I will test it out

So you still want the gui to be shown?

I dont really mind if its there or not. I did although test out the script you said and it worked. Thanks

Your welcome. Sorry if its not what your looking for exactly.

It’s ok it actually is what I was looking for.

Oh I did not see the post that said you wanted the whole gui to disappear.

Yea, sorry I was not really very specific and I forgot to mention that I wanted it to disappear.

It is fine. I hope your game comes along good!

Thank you:) me too it is pretty much my first game.

1 Like