Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I enable/disable a GUI from another GUI's button?

I can't make it do so, despite whatever I do, please I need help! I want my loading screen GUI's play button to be made that whenever said button is clicked, the loading screen gui flies off and the tutorial GUI comes up, but it never enables/disables , and the tutorial is crucial for the type of game I'm making

script.Parent.Parent.Enabled = false

game.ReplicatedStorage.StartUp.Frame.TextButton1.MouseButton1Click:Connect(function(cliCK)
	if script.Parent.Parent.Enabled == false then
		script.Parent.Parent.Enabled = true
	end
end)

3 comments

0

I put the code in a code block.

0

how exactly are the players gonna click something in replicated storage?

0

It's a loading screen gui that has GUI buttons, that works and the play button

1 answer

Ok so, first of all I hope this helps and that you will get a game on the front page. Here are your mistakes: I. Do not put a Screen Gui in ReplicatedStorage, or the Gui wont appear. Put Guis in StarterGui. II.Also, to activate a screen button, you must do the following: a. Create a textButton or imageButton. b. Create a function which detects the player's mousebutton. c. Here is an example of that function format:

    script.Parent.MouseActivator:Connect(function()

		  FrameVariableName.Visible = boolValue

    end)
    
d. scroll all the way to the bottom to see Valid Types Of Mouse Activators.

III. Thats it! I hope you would succeed with your code and become one great programmer some day!

List Of Mouse Activators:

  • MouseButton1Click -- Left Click
  • MouseButton1Up -- Left Button not clicked or held
  • MouseButton1Down -- Left Button Held
  • MouseButton2Click -- Right Click
  • MouseButton2Up -- Right Button not clicked or held
  • MouseButton2Down -- Right Button held
  • MouseEnter -- Not sure
  • MouseLeave -- Not sure, Sorry
  • MouseMoved -- Mouse moved I guess?
  • MouseWheelBackward -- Mouse Wheel moved Backwards
  • MouseWheelForward -- Mouse wheel moved forward

End

Please Upvote to support me! Hope this helped!

1 comment

0

Why not just look at the Wiki for what those activators are? Lol.

This discussion is preserved as it was. New answers, comments, and votes are closed.