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
 

Re: Custom PlayerList

Previous Thread :: Next Thread 
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Mar 2015 11:17 AM
Any reasons why this isn't working?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Mar 2015 12:15 PM
Am I doing something wrong?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Mar 2015 12:51 PM
:( Why isn't it working? Can someone point me in the right direction.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
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
darknightofVorhan is not online. darknightofVorhan
Joined: 23 Jun 2008
Total Posts: 667
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
20 Mar 2015 02:49 PM
Anyone?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
20 Mar 2015 02:51 PM
you could, but that would be reaaallllyyy inefficient and ugly.

⬡
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
21 Mar 2015 03:49 AM
I still can't figure it out. :/
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
21 Mar 2015 10:29 AM
Well, may I see it? I can always script mine for a Frame.
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
22 Mar 2015 01:04 PM
Wait for me to go on pc.
Report Abuse
FalconLoverGiraffe is not online. FalconLoverGiraffe
Joined: 24 Jun 2014
Total Posts: 456
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
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
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
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