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

GUI doesn't want to appear on the screen?

Why doesn't it work. The rocket spawns but the GUI doesn't show.

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.RocketSelected.Value == 'Rocket1' then
		game.ReplicatedStorage:WaitForChild('Rocket1')
		local clone = game.ReplicatedStorage.Rocket1:Clone()
		clone.Parent = workspace
		game.StarterGui.ScreenGui.LaunchMenu.Visible = true
		game.StarterGui.ScreenGui.Screen.Visible = false
		game.StarterGui.ScreenGui.RocketMenu.Visible = false
	end
end)

1 answer

✓ Accepted answer

You can't access the startergui.

script.Parent.MouseButton1Click:Connect(function(plr)
    if script.Parent.Parent.RocketSelected.Value == 'Rocket1' then
        game.ReplicatedStorage:WaitForChild('Rocket1')
        local clone = game.ReplicatedStorage.Rocket1:Clone()
        clone.Parent = workspace
        plr = game.Players:GetPlayerFromCharacter(plr.Parent)
        plr.PlayerGui.LaunchMenu.Visible = true
        plr.PlayerGui.ScreenGui.Screen.Visible = false
        plr.PlayerGui.ScreenGui.RocketMenu.Visible = false
    end
end)

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