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

Billboard Gui Only Visible To Specific Player?

Asked by 5 years ago

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.

1
just do that in a local script theking48989987 2147 — 5y
0
But my problem is I don't know what else to write. Darkcraft10 20 — 5y
0
i dont think you can make it visible to one player HappyTimIsHim 652 — 5y
0
But what about RoCitizens for example? Cops and robbers have billboards Darkcraft10 20 — 5y
View all comments (2 more)
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.... Lugical 425 — 5y
0
How would I go about doing that? Darkcraft10 20 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

0
I assume this would work well, just make sure that it's spelled as "BillboardGui" as an instance. Lugical 425 — 5y
Ad

Answer this question