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 3 years ago
Edited 3 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 3 years ago
Edited 3 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 — 3y
0
put it in server script WINDOWS10XPRO 438 — 3y
0
Alright it works thanks man Itsyaboyhands 6 — 3y
Ad

Answer this question