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

how do i change properties in a local script?

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)

4 comments

0

removed my answer. hes not willing to learn anything

0

again you dident need to i was just confused

0

i would highly suggest making a serversided player detection using UserId and not the name of the player with it being local sided any simple exploiter could just make it visible themselves and without using UserId if the player ever changes their name then you have to change it too in the script

0

this is for my singleplayer games, i only have it do this so that the normal player doesent think its a feature and gets overwhelmed, plus its hard to find it if your not looking for it and honestly if an exploiter is going to devalue their experience than that is on them

3 answers

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)


1 comment

0

best answer here... ignore the other ones.

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)

1 comment

1

there's no way this works.... how can player.Name = a table of values?

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