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: GUI Question

Previous Thread :: Next Thread 
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
24 Jul 2016 09:29 AM
This is displaying each user's username on their GUI, but I want it to display both usernames, if that makes sense.

thx, appreciate it.

local Player = game.Players.LocalPlayer
Players = {}

function displayPlayers()
for i,v in pairs(game.Players:GetPlayers()) do
table.insert(Players, #Players + 1, v.Name)
print(Players[i])
for i,v in pairs(game.Players:GetChildren()) do
v:FindFirstChild("PlayerGui"):WaitForChild("Screener"):WaitForChild("Wow").Text = Players[i]
end
end
end

displayPlayers()
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
24 Jul 2016 10:39 AM
B1
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
24 Jul 2016 01:02 PM
b2
Report Abuse
Smeers is not online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
24 Jul 2016 01:04 PM
"both usernames"

I don't get it.
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
24 Jul 2016 01:07 PM
sorry, my mistake.

every user whom is in the game will get their username on a gui. each user will have this gui that displays each username if that makes sense. a leaderboard on a gui basically.

but this just displays their own username, no other usernames.
Report Abuse
Smeers is not online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
24 Jul 2016 01:10 PM
Shouldn't this part of the code...
table.insert(Players, #Players + 1, v.Name)
be like this?
table.insert(Players, v.Name, #Players + 1)
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
24 Jul 2016 01:13 PM
local players = game.Players:GetPlayers()

all of the items in the table would be the player and to get their name use .Name


for _,v in pairs(players) do

print(v.Name)

end
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
24 Jul 2016 01:13 PM
local Max = 10 --how many people you want to show

for i,v in next, game.Players:GetPlayers() do
local label = Instance.new('TextLabel',leaderboard)
label.Text = v.Name
label.Size = UDim2.new(0,leaderboard.AbsoluteSize.X,0,leaderboard.AbsoluteSize.Y/Max)
label.Position = UDim2.new(0,0,0,i*label.AbsoluteSize.Y-label.AbsoluteSize.Y)
end


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