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

[No answer needed anymore] Mouse Click Event doesnt work (GUI Button). Why?

Asked by 6 years ago
Edited 6 years ago

Edit 2: Now it works. game.StarterGUI doesn't work. I now use Parent.

Hey, I don't know why, but this script doesn't work for me:

script.Parent.MouseButton1Click:connect(function()
    game.StarterGui.ScreenGui.Login.Visible = false
    game.StarterGui.ScreenGui.LoggingIn.Visible = true
    wait(5)
    game.StarterGui.ScreenGui.LoggingIn.Visible = false
    game.StarterGui.ScreenGui.Loading.Visible = true
end)

There's no message in the Output

I tried this too:

script.Parent.MouseButton1Click:connect(function()
    print(1)    
    game.StarterGui.ScreenGui.Login.Visible = false
    game.StarterGui.ScreenGui.LoggingIn.Visible = true
    print(2)
    wait(5)
    print(3)
    game.StarterGui.ScreenGui.LoggingIn.Visible = false
    game.StarterGui.ScreenGui.Loading.Visible = true
    print(4)
end)

But there's no Number in the Output again. The numbers aren't there too.

Edit: Now it prints the numbers. But the rest doesn't work.

0
You are using the starter gui not the player gui which is why this will never work. User#5423 17 — 6y
0
Im really new to Coding. I got it to working with StarterGUI. Does StarterGUI mean, everyone see's it? If yes, could you tell me how PlayerGUI works. OfficialCRUGG -5 — 6y

Answer this question