How to make a dev only gui

Change ResetOnSpawn to false on the ScreenGui.

Also, your loop doesn’t even do that. It stops once the DevGui is parented.

If you want to clone the GUI every time the player respawns:

-- This code is better than any of the other posts in this thread
local devs = {1998082358, 302070682, 1403193781, 105842946, 1467262997, 70025961}
local gui = game:GetService('ServerStorage').DevGui

local function playerAdded(plr)
	if table.find(devs, plr) then
		gui:Clone().Parent = plr.PlayerGui

		if gui.ResetOnSpawn then
			plr.CharacterAdded:Connect(function()
				gui:Clone().Parent = plr.PlayerGui
			end)
		end
	end
end

local players = game:GetService('Players')

players.PlayerAdded:Connect(playerAdded)

for _, player in ipairs(players:GetPlayers()) do
	playerAdded(player)
end
2 Likes

the script inside the gui also broken for sure

Thanks all for replies. Will test and reply back.
@thebrickplanetboy No, the gui works flawlessly.

The reset on spawn property is false so I don’t need this.

this type of scripts are not that safe. some exploiters can still accsess it using dark dex.

1 Like

What about putting it into ServerStorage (so clients can’t see it) and cloning it into PlayerGui from there?

1 Like

Thanks everyone who helped, especially @AridFights1 for the simple solution, thanks a lot everyone have a great day ahead!

yeah this might block some exploits but exploits with script compilers still can access to server stuff somehow.

1 Like

Then you can remove the CharacterAdded portion, but the rest of the code is still valid.

1 Like