b3njam1n
|
  |
| Joined: 05 Nov 2007 |
| Total Posts: 19389 |
|
|
| 12 Mar 2014 08:30 PM |
| Only is seeable when within range of it? It'd help to have less screen clutter in my level I'm working on |
|
|
| Report Abuse |
|
|
LetUsGame
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 199 |
|
|
| 12 Mar 2014 08:34 PM |
| You could check if there farther than a set distance and change the BillboardGui's PlayerToHideFrom property. Idk if there's a simpler way. |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
| |
|
b3njam1n
|
  |
| Joined: 05 Nov 2007 |
| Total Posts: 19389 |
|
|
| 12 Mar 2014 09:19 PM |
| Yeah that's a shame..I'm building a city that has buyable houses, each one has a blue orb in front. If I can't figure out a way to do this you're gonna have bubbles everywhere gahhh |
|
|
| Report Abuse |
|
|
LetUsGame
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 199 |
|
|
| 12 Mar 2014 09:21 PM |
| Use SurfaceGui's or Hover-activated ScreenGui's. Using BillboardGui's in conjunction with a distance limit should work tho I think. |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2014 09:23 PM |
We gave you a solution: 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 |
|
|
| Report Abuse |
|
|
b3njam1n
|
  |
| Joined: 05 Nov 2007 |
| Total Posts: 19389 |
|
|
| 12 Mar 2014 09:53 PM |
I appreciate that SecretAgent but for this piece
"script.Parent.GUI.Visible = false"
..that affects the visibility of the GUI like universally right? It needs to only make it visible for the player whose within that distance |
|
|
| Report Abuse |
|
|
b3njam1n
|
  |
| Joined: 05 Nov 2007 |
| Total Posts: 19389 |
|
|
| 12 Mar 2014 09:54 PM |
| For this value 'PlayerToHideFrom', is this a table or for only one character? |
|
|
| Report Abuse |
|
|
b3njam1n
|
  |
| Joined: 05 Nov 2007 |
| Total Posts: 19389 |
|
|
| 12 Mar 2014 10:42 PM |
I had to remove the while true do loop but it doesn't seem to work. I also made this one
distance = 20
while true do players = game.Players:GetPlayers() for i = 1,#players do character = players[i].Character
if (character.Torso.Positon - script.Parent.Position).magnitude < distance+1 then local List = script.Parent.BillboardGui.PlayerToHideFrom:GetChildren() if script.Parent.BillboardGui:FindFirstChild(players[i]) ~= nil then table.remove(List,players[i]) end elseif (character.Torso.Positon - script.Parent.Position).magnitude > distance then local List = script.Parent.BillboardGui.PlayerToHideFrom:GetChildren() if script.Parent.BillboardGui:FindFirstChild(players[i]) ~= nil then return else table.insert(List,players[i]) end end end end |
|
|
| Report Abuse |
|
|