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

How would you only make a GUI visible to the players you want to make it visible to and no one else?

So down below is what I got so far. This script isn't working though.. The GUI shows up if one of those people are in the server. If one of those three people are in the server then the GUI shows up for everyone. I only want it to show up on these three people's screen. No one else. Could someone help me with this?

repeat wait() 
until game.Players.LocalPlayer 

Player = game.Players.LocalPlayer 
Gui1 = Player.PlayerGui.VotingPanel.Button
Gui2 = Player.PlayerGui.VotingPanel.Button2
Gui3 = Player.PlayerGui.VotingPanel.Failed
Gui4 = Player.PlayerGui.VotingPanel.Passed

if Player.Name == "Apolloqi" or Player.Name == "VincentRussel" or Player.Name == "Mr_War" then 
Gui1.Visible = true
Gui2.Visible = true
Gui3.Visible = true
Gui4.Visible = true
else 
Gui1.Visible = false
Gui2.Visible = false
Gui3.Visible = false
Gui4.Visible = false
end
	

2 comments

0

I'm guessing based on this you are new to scripting? The way it's been coded hints me towards it.

0

Also don't put it in startergui if you are, allows hackers to access it, even with FE enabled.

3 answers

I think this method is bad. Lets try parenting it instead.

if Player.Name == "Apolloqi" or Player.Name == "VincentRussel" or Player.Name == "Mr_War" then -- check if player is who you want it to be

local Gui = (container):WaitForChild("Gui1") - must be accessable by client
Gui:Clone().Parent = game.Players.LocalPlayer.PlayerGui -- Clones it to the users PlayerGui.
end

Let me know if this doesnt work.

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