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

What's the error in this GUI script?

I've written it out exactly as I think it should, but it doesn't work. This should make the current Frame disappear, and a new one to come forward. Can you please help? Thanks :)

local CameraIcon = game.StarterGui.PhoneGUI.Menu.CameraIcon

CameraIcon.MouseButton1Click:connect(function()
	game.StarterGui.PhoneGUI.Menu.Visibile = false
	game.StarterGui.PhoneGUI.ComingSoon.Visibile = true
end)

2 comments

1

You are editing the gui in startergui. Change all the player's gui's instead.

0

How do I do that?

1 answer

✓ Accepted answer

As DragonZord said, you're actually editing the StarterGui instead of the Player's current GUI.

It's a simple fix, and you should be using a LocalScript for this, so:

local CameraIcon = game.Players.LocalPlayer.PlayerGui.PhoneGUI

phoneGui.Menu.CameraIcon.MouseButton1Click:connect(function()
    phoneGui.Menu.Visible = false
    phoneGui.ComingSoon.Visible = true
end)

3 comments

0

Oh wow. That was easy! Thanks :)

0

There was an error in this. But I've fixed it :D

0

My spelling for "Visible" is top notch :3

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