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

Limiting the distance to veiw a billboard GUI ?

How do I Limit the distance to view a billboard GUI ? The GUI is above a players head and I don't want people to see a load of writing over there screen when a player is over the other side of the map.. do I need to change the UDim position or something? Do I need a script for this? Any questions ill be happy to answer

1 comment

0

I don't think that is possible.

1 answer

✓ Accepted answer

Use Magnitude

Put this in the brick: -
-Change GUI to your GUI's name

distance = 20 --If a player is closer than X studs it will show
while true do
players  = game.Players:GetPlayers()
for i=1,#players do
char = players[i].Character
if (char.Torso.Position - script.Parent.Position).magnitude < distance+1 then
script.Parent.GUI.Visible = true
else
script.Parent.GUI.Visible = false
end
end

2 comments

0

Yep this is what i was looking for, thanks :)

0

You're welcome mister :)

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