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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|