How do i Adoree a Billboard Gui to a Part if the player is within range of it, Also how would I do it to only certain parts, not all the parts
Check the magnitude between the player and the part.
Calculate it with (character.HumanoidRootPart.Position - part.Position).magnitude
Then compare it with the amount of studs you need to be near to get the gui to show
Another approach is to use an invisible proximityprompt with line of sight off, and then set eh adornee when the prompt is shown, and then put it back when it is hidden.
local part = your.part.path
local billboard = your.billboardgui.path
local originalAdornee = billboard.Adornee
local prox = Instance.new("ProximityPrompt", part)
prox.RequiresLineOfSight = false
prox.MaxActivationDistance = 20
prox.Style = Enum.ProximityPromptStyle.Custom
prox.PromptShown:Connect(function()
billboard.Adornee = part
end)
prox.PromptHidden:Connect(function()
billboard.Adornee = originalAdornee
end)