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

Billboard Gui Only Visible To Specific Player?

I have a small script here, and I need the billboard to only be visible to a specific player.


Brick = script.Parent
Brick.Touched:connect(function()

end)

I don't know what to do from here, have no idea what to do now.

6 comments

1

just do that in a local script

0

But my problem is I don't know what else to write.

0

i dont think you can make it visible to one player

0

But what about RoCitizens for example? Cops and robbers have billboards

0

Try placing the parent as a camera to make a local billboard gui, i suppose. Note that this has never been endorsed or encouraged by roblox so....

0

How would I go about doing that?

1 answer

You can do this in a local script, as filtering enabled prevents anything instanced from the client from showing up on the server. Also, if you were to do it in a local script, you should check if a player touched the part and if it is the local player

local plr = game.Players.LocalPlayer
local brick = workspace.Brick
brick.Touched:Connect(function(hit)
	if hit:IsDescendantOf(plr.Character) then
		local billboardgui = Instance.new("BillBoardGUI")
		--do whatever you want
		billboardgui.Parent = brick
	end
end)

Also, you can clone a preexisting gui with the :Clone function

local plr = game.Players.LocalPlayer
local brick = workspace.Brick
brick.Touched:Connect(function(hit)
	if hit:IsDescendantOf(plr.Character) then
		local billboardgui = game.ReplicatedStorage.BillBoardGui:Clone()
		--do whatever you want
		billboardgui.Parent = brick
	end
end)

A couple of things to take away:

  1. use :Connect instead of :connect

  2. always use local variables if the scope of the variable is the entire script

1 comment

0

I assume this would work well, just make sure that it's spelled as "BillboardGui" as an instance.

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