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

Could someone tell me what I'm doing wrong in my script to make certain people have a GUI?

local CoolBoy = {
    3179316 ,31862508,
}

local Player = players.LocalPlayer
local Gui = Player.PlayerGui.SliderGui
local found = false

for i =1, #CoolBoy do
    if CoolBoy[i]== Player.UserId then
        Gui.Visible = true
        found = true
    else
        if not found then
               Gui.Visible = false
        end
    end
end

Notes: This is all in a LocalScript inside of StarterPlayer>StarterPlayerScripts, the GUI is called SliderGui and is in StarterGui. Alright thanks if you can help.

1 comment

0

Try waiting for the PlayerGui; :WaitForChild("PlayerGui")

1 answer

is players defined? If it isn't, there's your problem.

Another thing that will probably help is replacing line 6 with:

local Gui = Player:WaitForChild("PlayerGui"):WaitForChild("SliderGui")

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