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

How do you make a billboard GUI visible to only specific people?

Asked by 8 years ago
Edited 8 years ago

I was wondering how to make this script visible to only people/group that I set it to. I've worked on this for like 3 hours now and can't figure it out.

01game.Players.PlayerAdded:connect(onPlayerRespawned)
02function onPlayerRespawned(newPlayer)
03    wait(1)
04    if newPlayer.Name == "AthenaPerson" then
05        gui=Instance.new("BillboardGui")
06        gui.Parent=newPlayer.Character.Head
07        gui.Adornee=newPlayer.Character.Head
08        gui.Size=UDim2.new(2,0,2,0)
09        gui.StudsOffset=Vector3.new(0,1,0)
10        gui.AlwaysOnTop=true
11        label=Instance.new("ImageLabel")
12        label.Image="rbxassetid://819434834"
13        label.Size=UDim2.new(0,100,0,100)
14        label.Size=UDim2.new(1,0,1,0)
15        label.Position=UDim2.new(0,0,-0.5,0)
View all 29 lines...

2 answers

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
8 years ago
Edited 8 years ago
01local players = game:GetService('Players')
02local group_id = 1 -- Group id
03 
04-- Pre-made so the script doesn't have to keep doing it.
05local gui = Instance.new("BillboardGui")
06    gui.Size = UDim2.new(2,0,2,0)
07    gui.StudsOffset = Vector3.new(0,1,0)
08    gui.AlwaysOnTop = true
09local label = Instance.new("ImageLabel")
10    label.Image = "rbxassetid://819434834"
11    label.Size = UDim2.new(0,100,0,100)
12    label.Size = UDim2.new(1,0,1,0)
13    label.Position = UDim2.new(0,0,-0.5,0)
14    label.BackgroundTransparency = 1
15    label.Parent = gui
View all 52 lines...
Ad
Log in to vote
0
Answered by 8 years ago

You can do game.Players.LocalPlayer. Then if the player's name is specifically "Name" then make the GUI Visible. Now what i suggest you doing is to create the GUI first and make sure the GUI is invisible. Then do this code;

1local player = game.Players.LocalPlayer
2local GUI = --Where this billboardgui is and specifically the object, (Textlabel, TextButton, etc.)
3 
4if player.Name == "Name" then
5    GUI.Visible = true
6end

Make sure this is a localscript in StarterPlayerScripts

This will make it visible to the LocalPlayer. Therefore no one else can see it.

If I helped then please accept answer and upvote.

Answer this question