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

Limiting the distance to veiw a billboard GUI ?

Asked by 10 years ago

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

0
I don't think that is possible. alphawolvess 1784 — 10y

1 answer

Log in to vote
1
Answered by
iNicklas 215 Moderation Voter
10 years ago

Use Magnitude

01Put this in the brick: -
02-Change GUI to your GUI's name
03 
04distance = 20 --If a player is closer than X studs it will show
05while true do
06players  = game.Players:GetPlayers()
07for i=1,#players do
08char = players[i].Character
09if (char.Torso.Position - script.Parent.Position).magnitude < distance+1 then
10script.Parent.GUI.Visible = true
11else
12script.Parent.GUI.Visible = false
13end
14end
0
Yep this is what i was looking for, thanks :) Bubbles5610 217 — 10y
0
You're welcome mister :) iNicklas 215 — 10y
Ad

Answer this question