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

Why is my GUI not showing up on the screen?

Asked by 4 years ago
Edited 4 years ago

Hi there! I've been scripting a few months now and I'm trying to use GUIs, but they just aren't working. Could someone please help me?

This script is in a local script, not a script. I don't know if that's the problem or not.

script.Parent.MouseButton1Click:Connect(function()
    game.StarterGui.ModPanel.Enabled = true --// Opens the GUI
    script.Parent.Parent.Parent.Enabled = false --// Button to open GUI
    game.StarterGui.ModPanel.ModPanel.Active = true --// The second ModPanel is a frame.
end)

When I go and test the game, it says that everything is active/enabled, but it doesn't show that.

I'm hoping someone can help me as I have no idea what's happening and the output isn't showing me.

0
Its Because Of The Scale User#34743 0 — 4y
0
so... the gui is not scaled (adjusted) to different sizes of screens.. try to put it in the middle and then start the game and it should be moved to the side a bit if its not adjusted User#34743 0 — 4y
0
im having the exact same problem User#34743 0 — 4y
0
It is in the middle; already tried that. ParticularlyPenguin 71 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

It's because you're opening the GUI in the StarterGui, not in the PlayerGui (it's in the guis that the player can see)

Try this

local player = game.Players.LocalPlayer --Gets the player that the localscript is in
local playerGui = player:WaitForChild("PlayerGui") --Gets the player GUI

script.Parent.MouseButton1Click:Connect(function()
    playerGui.ModPanel.Enabled = true --// Opens the GUI
    script.Parent.Parent.Parent.Enabled = false --// Button to open GUI
    playerGui.ModPanel.ModPanel.Active = true --// The second ModPanel is a frame.
end)
0
Thank you so much! I thought this was going to be an answer but second guessed myself. I guess this was the answer. Again, thank you! ParticularlyPenguin 71 — 4y
0
No problem! TheBigBro122 427 — 4y
Ad

Answer this question