|
| 19 Mar 2015 04:17 PM |
Hello,
How would I make a custom playerlist? The reason I'm making a custom one is because I want the game to look consistent, so, how? I don't want scripts, I want a way of doing it. I have tried this:
for i, v in pairs(game.Players:GetPlayers()) do if v then if v ~= nil then local NewHolder = Holder:Clone() NewHolder.Visible = true NewHolder.Parent = CLBG NewHolder.Name = v.Name.."_Holder" NewHolder.Position = UDim2.new(0, 0, 0 + CurrentPosition, 0) local Name = NewHolder:WaitForChild("ExampleName") Name.Name = "Name" Name.Visible = true Name.Text = v.Name local Rank = NewHolder:WaitForChild("ExampleRank") Rank.Name = "Rank" Rank.Visible = true Rank.Text = v:WaitForChild("leaderstats"):WaitForChild("Rank").Value print(v:WaitForChild("leaderstats"):WaitForChild("Rank").Value) CurrentPosition = CurrentPosition + 23 end end end
Paired with a PlayerAdded and PlayerRemoving event. However, the GUI only shows for one person, and the position of it is the same.
Thanks in advance. |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2015 04:20 PM |
"if v then if v ~= nil then" First of all, do not use "~= nil". Secondly, these do the same thing for our purposes. Lastly, just by having v, we already know that it is not nil. Remove both >:(
"print(v:WaitForChild("leaderstats"):WaitForChild("Rank").Value)" You already waited for them, so don't wait for them again.
"NewHolder:WaitForChild("ExampleRank")" Same thing. You already waited. Don't wait again.
Try using PlayerAdded and PlayerRemoving to detect when players leave and enter, is is more efficient and is much cleaner and more reliable. |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2015 05:01 PM |
Jarod,
I didn't wait for ExampleRank twice... There are 2 things which begin with "Example", ExampleName, and ExampleRank.
I removed the "if v then if v ~= nil then" now.
Here is what I have so far:
function CreateLeaderboard() local CurrentPosition = 0 for i, v in pairs(game.Players:GetPlayers()) do local PlayerGui = v:WaitForChild("PlayerGui") local CoreGUI = PlayerGui:WaitForChild("CoreGUI") local BG = CoreGUI:WaitForChild("Background") local CLBG = BG:WaitForChild("CustomLeaderboardBG") local Holder = CLBG:WaitForChild("Holder") local NewHolder = Holder:Clone() NewHolder.Visible = true NewHolder.Parent = CLBG NewHolder.Name = v.Name.."_Holder" NewHolder.Position = UDim2.new(0, 0, 0 + CurrentPosition, 0) local Name = NewHolder:WaitForChild("ExampleName") Name.Name = "Name" Name.Visible = true Name.Text = v.Name local Rank = NewHolder:WaitForChild("ExampleRank") Rank.Name = "Rank" Rank.Visible = true Rank.Text = v:WaitForChild("leaderstats"):WaitForChild("Rank").Value CurrentPosition = CurrentPosition + 23 end end
game.Players.PlayerAdded:connect(function(player) CreateLeaderboard() end)
game.Players.PlayerRemoving:connect(function(player) CreateLeaderboard() end) |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 02:57 AM |
When I tested it, it only appeared for 1 player, and it was still in the same position, and the others couldn't see it.
|
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 11:17 AM |
| Any reasons why this isn't working? |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 12:15 PM |
| Am I doing something wrong? |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 12:51 PM |
| :( Why isn't it working? Can someone point me in the right direction. |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 12:53 PM |
any time a player joins or leaves find all players that aren't in the playerlist and add them to the list find all players in the list that aren't ingame and remove them
⬡ |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 01:10 PM |
| The code for Roblox's player list is inside your client's code. It is in lua, so you just need to make it work in a playerGui instead of in the CoreGui. You can then edit it any way you want. |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 01:26 PM |
CoreGUI is not Roblox's CoreGUI. I made a ScreenGUI in StarterGui that is called CoreGUI. I just named it since I'm going to make a custom chat as well, and both Playerlist and Chat are CoreGUI's so I called it CoreGUI. :P
@Dev
Can't I just remake the leaderboard everytime a person leaves/join? The current way I'm doing it should be fine, but it's only appearing for one person. |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Mar 2015 02:51 PM |
you could, but that would be reaaallllyyy inefficient and ugly.
⬡ |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2015 03:45 PM |
Why would that be?
But the real question is, why isn't the code I have not working? |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 03:49 AM |
| I still can't figure it out. :/ |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 05:41 AM |
| Found out one thing, I did UDim2.new(0, 0, 0 + CurrentPosition, 0) instead of UDim2.new(0. 0, 0, 0 + CurrenPosition), but still it isn't working. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 06:05 AM |
Seriously.. 100+ Views... And no replies yet... Guys, if you don't know how to fix it, atleast give me something that will help me. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 08:31 AM |
| I feel I should give you my script and you can see what i did. But warning, i used scrolling frame. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 10:29 AM |
| Well, may I see it? I can always script mine for a Frame. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Mar 2015 01:06 PM |
custom chat is easy you shouldn't have a problem with that
if you are ahving trobule with your leaderboard just look at the ufnctions used in the leaderboard script
Leaderboard script:
search custom leaderboard in free models |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2015 01:19 PM |
Google "ROBLOX/Core-Scripts - GitHub" and edit the ROBLOX leaderboard script to work in a screen gui (you have to remove a few different things, took about two hours to find everything by myself lol). Then you can learn from it.
You're welcome. |
|
|
| Report Abuse |
|
|