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
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)
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 :)