|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 11 Jun 2017 10:16 PM |
| How would I make that change? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 11 Jun 2017 10:22 PM |
| UDim2.new(0, 0, 0.02 * i, 0) |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2017 10:26 PM |
| It fixes the problem a little bit but now there is an open slot on top |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|