Cant get to enable gui in playerGui

  1. What do you want to achieve?
    I want to get a simple way of enabling a gui inside of the PlayerGui
    The script are a local script and are in StarterCharacterScripts

  2. What is the issue?
    When i press a ready button two guis should pop up
    But instead the guis stay disabled not showing

  3. What solutions have you tried so far?
    i have look and other fourms in the devfourm with the same issue the driffence was mine needed to enable when i press a gui button and when i made that it still didnt work

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

ill post the script here

local Button = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui").MainMenu.Frame.ReadyButton
local PlayerGUI = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui").PlayerCounterGui

local function UpdateUI()
	PlayerGUI.Enabled = true
end

Button.MouseButton1Click:Connect(function()
	PlayerGUI.Enabled = true
end)

Are you receiving any errors in your output? I created 2 Guis, MainMenu(Enabled=true) and PlayerCounterGui(Enabled=false) and set them up like you have and put your script in StartCharacterScripts and when I click the Ready button the counter pops up so it looks like the code is working at least.

Sorry if I don’t understand this well (I’ve gotten really rusty at coding on roblox) but for a function to work, won’t you need to call it somewhere in the script?

Not sure if it’s related in any way

Your script has connected a function to the MouseButton1Click event so if you click the button it sets the Enabled to true which will show the other Gui.

It needs to be called somewhere. Commonly, functions are sent to an Event:Connect() deal, and the function calls it later. I imagine that he started that way, but removed it as part of debugging. In this case it doesn’t matter, since the event and UpdateUI both do the same thing.

1 Like

I have added the local script inside of the gui and removed the function but i would like to make it work from StartCharacterScripts

Thats only a folder used by your game to clone and provide the GUIs in it to the players that join. Theres no point of wanting to run something there

ok am closing the fourm as i dont think it matters anymore as i have found a fix kinda

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.