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

Im trying to make a gui that only shows for me But it doesnt seem to be working?

So im trying to make a code that enables a gui only for me But it doesnt seem to be working can somebody help

local p = script.Parent.Parent.Parent.Parent.Name

local function enable()

game.Players:WaitForChild(p).PlayerGui.OverSeerGui.Enabled = true

end

if p == "Itsyaboyhands" then enable()

end

1 answer

✓ Accepted answer

try this

local playerthatcanuse = {"Itsyaboyhands"}
local gui = game.StarterGui.OverSeerGui

game.Players.PlayerAdded:Connect(function(plr)
	table.foreach(playerthatcanuse, function(i,v)
		if plr.Name == v then
			local guiclone = gui:Clone()
			guiclone.Parent = plr:WaitForChild("PlayerGui")
			guiclone.Enabled = true
		end
	end)
end)

if it doesn't work, dm me at Blue Duck#8344

3 comments

0

It doesnt work but i put it in a local script could that be why?

0

put it in server script

0

Alright it works thanks man

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