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

What's the error in this GUI script?

Asked by
cboyce1 40
9 years ago

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)
1
You are editing the gui in startergui. Change all the player's gui's instead. EzraNehemiah_TF2 3552 — 9y
0
How do I do that? cboyce1 40 — 9y

1 answer

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

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)

0
Oh wow. That was easy! Thanks :) cboyce1 40 — 9y
0
There was an error in this. But I've fixed it :D cboyce1 40 — 9y
0
My spelling for "Visible" is top notch :3 cboyce1 40 — 9y
Ad

Answer this question