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

GUI script(s) with no spelling/syntax errors not working?

I am trying to create a welcome screen GUI That can:

close / open the developer log and click "play" and hide the welcome screen

The only script that is functioning is the starterScript, The rest just wont work.

script to click on the log button and open / close developer log (openLogScript)

script.Parent.MouseButton1Click:Connect(function()
	if game.StarterGui.ScreenGui.welcomeScreen.log.Visible == false then
			game.StarterGui.ScreenGui.welcomeScreen.log.Visible = true
		else
		game.StarterGui.ScreenGui.welcomeScreen.log.Visible = false
		end
end)

script to click the play button and close the GUI (playScript)

script.Parent.MouseButton1Click:Connect(function()
	game.StarterGui.welcomeScreen.Visible = false
end)

script to set things up at the start (starterScript)

game.StarterGui.ScreenGui.welcomeScreen.Visible = true
game.StarterGui.ScreenGui.welcomeScreen.log.Visible = false

object tree:

ServerScriptService
	starterScript
StarterGUI
	Screen GUI
		welcomeScreen
			log (developer log)
			play (play button)
				playScript
			openLog (log button)
				openLogScript

3 comments

0

Is it supposed to open the welcome screen when a player joins or open when you click a button

0

it opens the welcome screen when you join, you can see if you looked at starterScript

0

Oh I see the problem now I'll post in answers

2 answers

✓ Accepted answer

seems to be the indenting. try uhh.

script.Parent.MouseButton1Click:Connect(function()
	if game.StarterGui.ScreenGui.welcomeScreen.log.Visible == false then
		game.StarterGui.ScreenGui.welcomeScreen.log.Visible = true
	else
		game.StarterGui.ScreenGui.welcomeScreen.log.Visible = false
	end
end)

1 comment

0

thats legit what i have right now

Your starterscript should be like this so that it shows for everyone that joins

game.Players.PlayerAdded:Connect(function(p)
	p.PlayerGui.ScreenGui.welcomeScreen.Visible = true
	p.PlayerGui.ScreenGui.welcomeScreen.log.Visible = false
end)

Your openLogScript can be shorter by doing this

local log = script.Parent.Parent.Log

script.Parent.MouseButton1Click:Connect(function()
	log.Visible = not log.Visible
end)

Your playScript goes into the startergui to make the whole thing invisible, try this

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
end)

You shouldn't go into the startergui to make things invisible, try doing script.Parent to get things. Let me know if this works :)

2 comments

0

Didn't work. You may have revamped the scripts, but it didn't change anything. Ill close the discussion.

0

Then it's something wrong with your gui then

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