Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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
0
Is it supposed to open the welcome screen when a player joins or open when you click a button MediaHQ 53 — 3y
0
it opens the welcome screen when you join, you can see if you looked at starterScript TheNewSector_D 4 — 3y
0
Oh I see the problem now I'll post in answers MediaHQ 53 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

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)
0
thats legit what i have right now TheNewSector_D 4 — 3y
Ad
Log in to vote
0
Answered by
MediaHQ 53
3 years ago
Edited 3 years ago

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

0
Didn't work. You may have revamped the scripts, but it didn't change anything. Ill close the discussion. TheNewSector_D 4 — 3y
0
Then it's something wrong with your gui then MediaHQ 53 — 3y

Answer this question