Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

0
I'm guessing based on this you are new to scripting? The way it's been coded hints me towards it. H4X0MSYT 536 — 7y
0
Also don't put it in startergui if you are, allows hackers to access it, even with FE enabled. H4X0MSYT 536 — 7y

3 answers

Log in to vote
0
Answered by 7 years ago

You have to make it a function and call it.

Ad
Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
7 years ago

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.

Log in to vote
0
Answered by 7 years ago
game.Workspace.children.CanColide = false

Answer this question