so im trying to make a developer console for beta testing but I only want it to show up for specific people but the script won't change the visibility property at all, how do I fix this?
this is the script itself:
local whitelist = {"example1","example2",} local player = game.Players.LocalPlayer game.StarterGui.ScreenGui.conactive.Visible = false print ("working") game.Players.PlayerAdded:Connect(function() if player.Name == whitelist then end end)
local whitelist = {"example1","example2",} local player = game.Players.LocalPlayer player.PlayerGui.ScreenGui.conactive.Visible = false print ("working") game.Players.PlayerAdded:Connect(function() local found_flag = false for i,v in pairs(whitelist) do if player.Name==v then found_flag=true end end if found_flag then -- Make the visibility bool true end end)
cough StArTeRgUi good luck getting players guis from startergui. Its supposed to be PlayerGui. Mark a answer as answered so others will see the solution for their problem!
If you are trying to access the local player's GUI with a player variable, you should use:
player.PlayerGui.ScreenGui.conactive.Visible = false
Trying to control the GUI listed in StarterGui won't do anything. The final script you are looking for is:
local whitelist = {"example1","example2",} local player = game.Players.LocalPlayer player.PlayerGui.ScreenGui.conactive.Visible = false print ("working") game.Players.PlayerAdded:Connect(function() if player.Name == whitelist then -- Make the visibility bool true end end)