✓ Accepted answer
I have written a script like this once, but forgive me because I can't find it to copy in the code, but it worked like this: It created the BBGUI, and set the BBGUI's Adornee property to the object its supposed to be connected to, then it cloned and parented the BBGUI to the localplayer, making it so only they can view it, it looks like so(Did my best recreation, excuse the sloppyness or possible inaccuracy):
local Player = game.Players.localPlayer;
local GuiPart = game.Workspace:FindFirstChild("GuiAdornee");
local MaxRange = 1000;
local BBGUI = Instance.new("BillboardGui", script.Parent);
BBGUI.Adornee = GuiPart;
BBGUI.Size = UDim2.new(1, 0, 1, 0);
while true do
if Player:DistanceFromChatacter(GuiPart.CFrame.p) > MaxRange then
BBGUI.Enabled = false
else
BBGUI.Enabled = true
end
wait()
end
Hope that helps. :)
OH, one last thing, this will have to be in a LocalScript in the Player's PlayerGui.
1 comment
Thanks!