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

Is there a way to make BillBoardGui's go away after a certain distance?

Say that you are within 1000 studs of a BillBoardGUI, and no matter how big the text/BillBoardGui is, you can still view it. But if you step outside the 1000 stud radius, you cannot see the BillBoardGui.

Is there a scripting method that accomplishes this or not?

1 answer

✓ 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);	--[ This makes a BBGUI for every player, since the Player is the game.Players.localPlayer. ]
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

0

Thanks!

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