{SOLVED} GUI not enabling through PlayerGui even in a Server-Sided Script

I am trying to give myself KickGUI permissions through a Server-Sided Script.
Here’s the code:

repeat wait(0.1) until game:IsLoaded()
game.Players.PlayerAdded:Connect(function(p)
	local plrgui = p:WaitForChild("PlayerGui"):WaitForChild("KickGUI")
	if p.Name == "hasoco" then
		plrgui.Enabled = true
	end
end)

If you know anything that can help, it will be appreciated!

Have you checked if the if statement ran with a print statement?

No, the statement didn’t run. I tried printing something but it did not print.

repeat wait(0.1) until game:IsLoaded()

I don’t think this is required if you have the PlayerAdded event before everything else, but check each line to see where your print statements stop running.

I removed the repeat part and it worked, thank you.

1 Like

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