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

1 comment
Is this placed inside the player?