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

How do you fix buttons that don't work unless used with command line?

Asked by 5 years ago
Edited 5 years ago

When I put some code into a script, it does not work, but when I put it in the command line, it works. Here is my code:

Mode1Path = game.StarterGui.ModeSelection.ModeSelect.Mode1
Mode2Path = game.StarterGui.ModeSelection.ModeSelect.Mode2
Mode3Path = game.StarterGui.ModeSelection.ModeSelect.Mode3
Mode1Path.MouseButton1Click:connect(function()
    game.StarterGui.ModeSelection.Mode1.Visible=true
    game.StarterGui.ModeSelection.Mode2.Visible=false
    game.StarterGui.ModeSelection.Mode3.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode1.Visible=true
    game.StarterGui.GameGUI.StatusBar.Mode2.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode3.Visible=false
end)
Mode2Path.MouseButton1Click:connect(function()
    game.StarterGui.ModeSelection.Mode1.Visible=false
    game.StarterGui.ModeSelection.Mode2.Visible=true
    game.StarterGui.ModeSelection.Mode3.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode1.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode2.Visible=true
    game.StarterGui.GameGUI.StatusBar.Mode3.Visible=false
end)
Mode3Path.MouseButton1Click:connect(function()
    game.StarterGui.ModeSelection.Mode1.Visible=false
    game.StarterGui.ModeSelection.Mode2.Visible= false
    game.StarterGui.ModeSelection.Mode3.Visible=true
    game.StarterGui.GameGUI.StatusBar.Mode1.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode2.Visible=false
    game.StarterGui.GameGUI.StatusBar.Mode3.Visible=true
end)
game.StarterGui.ModeSelection.ModeSelect.Continue.MouseButton1Click:connect(function()
    game.StarterGui.ModeSelection.ModeSelect.Visible=false
end)

Why does it not process when put into a script?

edit: Found the answer some other place

0
Is this placed inside the player? Prestory 1395 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Okay, I think I found the problem. When I put it in different scripts, it worked. Thanks Prestory for the help

Ad

Answer this question