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 » Scripting Helpers
Home Search
 

Re: Displaying Table Objects

Previous Thread :: Next Thread 
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
29 Oct 2011 09:17 AM
I want to display a tables object in a Gui TextLabel. As in,

game.ScreenGui.Frame.TextLabel.Text = ""

How would I get a table to display its first object in the text, the object is the players name.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
29 Oct 2011 09:20 AM
Well, that line of code wouldn't work no matter what because you're indexing the StarterGui. You have to index a player's PlayerGui to be able to do something like this.

Anyways, to index the first value in a table, use this:

table[1]

-You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
29 Oct 2011 09:24 AM
Could you show me how to index it?

Also, could I do something like this.

"The player who came first is.."..table[1].." Nice work!"

Thats just a guess on how I would do it, would what show the text, then the first object in the table, then continue the text?
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
29 Oct 2011 09:27 AM
The easiest way to do something like this is to put a script directly inside the TextLabel, and put this in:

script.Parent.Text = "The player who came first is.."..table[1].."! Nice work!"

-You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
29 Oct 2011 09:33 AM
Okay, how would I index it, I'd have a main script that I'd like it to be in so it updates and work great every round.
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
29 Oct 2011 09:34 AM
*How would I index it if it was in another script.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
29 Oct 2011 09:35 AM
for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.ScreenGui.Frame.TextLabel.Text = "The player who came first is.."..table[1].."! Nice work!"
end

-You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
29 Oct 2011 09:43 AM
Wait... I don't want this script to show up to just single players, I want it to show up for everyone. Also, for what I'm trying to do, that wouldn't really work. This is what I've got:

game.ScreenGui.Rankings.Winner.Text = "1 ".._G.touched[1].." ".._G.time[1].." 100"
if _G.touched[2] == nil then
game.ScreenGui.Rankings.Second.Text = "Didn't finish D:"
elseif _G.numplayers > 2 then
game.ScreenGui.Rankings.Second.Text = "2 ".._G.touched[2].." ".._G.time[2].." 75"
end
end

It's only really compatible with 2 players at the moment. Rankings is a frame, Winner and Second are TextLabels.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
29 Oct 2011 09:47 AM
...My script would do it for all players.

Also, there is no ScreenGui in game.. You have to index the ScreenGui from a PLAYER'S PlayerGui.

-You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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