generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Any way to make a billboard GUI that only when within range?

Previous Thread :: Next Thread 
b3njam1n is not online. 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 is not online. 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 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
12 Mar 2014 08:43 PM
use magnitude
Report Abuse
b3njam1n is not online. 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 is not online. 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
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image