Im new to coding, trying the button click code, it may sound stupid but how would i open a gui?

6 Likes

Hi, You need a Local Script which goes under The Screen Gui. The Local script is a client version of Server Script, this gives the ability to get input from the Player which happens on Screen, usually immpossible to get from Server Script.
I suggest you watch videos about using Gui’s and I suggest to use Lua Documentation

5 Likes

Like @X0BaconHairDude0X said, you need to make that a local script.

To actually toggle the GUI, you could use an if statement that checks if .Visible is true. For example:

if script.Parent.YourFrameOrWhatever.Visible == true then
	script.Parent.YourFrameOrWhatever.Visible = false
else
	script.Parent.YourFrameOrWhatever.Visible = true
end
4 Likes

hey, you can make a LocalScript under the text button w/ the following code:


local frame = script.Parent.Parent.Frame

script.Parent.MouseButton1Click:connect(function()
  if frame.Visible == false then
    frame.Visible = true
  else
    frame.Visible = false
end)

if you need more luau help, dm me and i can teach you

3 Likes

Thank you so much, if you have discord my username is planets0001#4482 if not ive sent you a friend request on roblox. Help is very much appreciated!

1 Like

i added you, im tesla.man

30303030303030303030303030303030

is that discord or roblox? Not sure

ive sent you a roblox friend req whats ur discord one?

Discord.

30303030303030303030303030

client scripts are not expected for guis in StarterGui server scripts would work in guis too

client scripts are not expected for guis in StarterGui

You literally have to use localscripts for guis, server scripts do work but are not recommended

Roblox literally says to use localscripts, back up your facts before replying

bro stop talking random things. who and where did said ‘server scripts do work but are not recommended’?

Step 1: Make this a LocalScript under StarterGui.ScreenGui
Step 2: Make the code affect the client’s copy of the ScreenGui and not the game’s:

script.Parent.TextButton.MouseButton1Click:Connect(function()
   script.Parent.Frame.Visible = true
end)

Or just use not.

Frame = script.Parent.YourFrameOrWhatever
Frame.Visible = not Frame.Visible

I typically do that but I didn’t want to confuse him.

Its not reccomended by the Developers. Theres a form about this.

Don’t suggest people to use serverscript as the norm, plus client scripts are normally expected.

ive sent, althought your on dnd