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

GUI Not Getting Enabled/Disabled Until Character Reset?

The script that I made is supposed to change a text value and count down until the round starts, and the GUI afterward is supposed to disable. Though it doesn't disable until the character resets. The changing value works because I added a script with a function that whenever a value changes, so does the TextBox GUI. I tried the same function with enabling/disabling the GUI, but with no success. How would I enable/disable a GUI without having the character reset? The code I have will be attached below.

local st = game.StarterGui.RoundGUI
local stTime = st.Frame.Timer
local val = script.StartTime

while (wait(1)) do
	st.Enabled = true
	for i=5, 0, -1 do
		val.Value = i
		stTime.Text = "Starting in: "..val.Value
		wait(1)
	end
	st.Enabled = false
end

1 answer

✓ Accepted answer

You are changing the StarterGui which will appear whenever GUI resets. In your case, after every character reset. You need to change your actual GUI, which is located in game.Players.[player_name].PlayerGui. This folder is only visible when the game is running

1 comment

0

Thank you very much!

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