Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

0
It doesnt work but i put it in a local script could that be why? Itsyaboyhands 6 — 2y
0
put it in server script WINDOWS10XPRO 438 — 2y
0
Alright it works thanks man Itsyaboyhands 6 — 2y
Ad

Answer this question