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 » Scripters
Home Search
 

GUI Pileup problem

Previous Thread :: Next Thread 
xXRevengeCreeperXx is not online. xXRevengeCreeperXx
Joined: 22 Nov 2012
Total Posts: 699
11 Jun 2017 09:52 PM
When a player leaves it piles the list of names on top of each other and thats not how I want them. How do i fix this problem?

game.Players.PlayerRemoving:connect(function(player)
local SB = PC.Server.Players
local find = SB:FindFirstChild(player.Name)
if find then
find:Destroy()
for i,v in pairs(SB:GetChildren()) do
v.Position = UDim2.new(0, 0, 0 + (.02 * #SB:GetChildren()) , 0)
end
end
end)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
11 Jun 2017 09:58 PM
"v.Position = UDim2.new(0, 0, 0 + (.02 * #SB:GetChildren()) , 0)"
Report Abuse
xXRevengeCreeperXx is not online. xXRevengeCreeperXx
Joined: 22 Nov 2012
Total Posts: 699
11 Jun 2017 10:02 PM
I understand thats the issue but theres more than 1 and each should be right under one another instead of piling up
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
11 Jun 2017 10:10 PM
You are setting each item to the same position.

"UDim2.new(0, 0, 0 + (.02 * #SB:GetChildren()) , 0)"

Doesn't change with each iteration of the loop.
Report Abuse
xXRevengeCreeperXx is not online. xXRevengeCreeperXx
Joined: 22 Nov 2012
Total Posts: 699
11 Jun 2017 10:16 PM
How would I make that change?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
11 Jun 2017 10:22 PM
UDim2.new(0, 0, 0.02 * i, 0)
Report Abuse
xXRevengeCreeperXx is not online. xXRevengeCreeperXx
Joined: 22 Nov 2012
Total Posts: 699
11 Jun 2017 10:26 PM
It fixes the problem a little bit but now there is an open slot on top
Report Abuse
xXRevengeCreeperXx is not online. xXRevengeCreeperXx
Joined: 22 Nov 2012
Total Posts: 699
11 Jun 2017 10:36 PM
I fixed the problem by doing UDim2.new(0,0,0 + (.02 * i - .02), 0) Thx for your input it really helped dude
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
11 Jun 2017 11:40 PM
First, what is up with the (0 +)?
0 + x = x, there is no reason to do it.


Second, for better results you should do this:

.02 * (i - 1)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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