Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

0

Is this placed inside the player?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.