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.
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.
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:
use :Connect instead of :connect
always use local variables if the scope of the variable is the entire script
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.
6 comments
just do that in a local script
But my problem is I don't know what else to write.
i dont think you can make it visible to one player
But what about RoCitizens for example? Cops and robbers have billboards
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....
How would I go about doing that?