|
| 06 Jan 2015 06:43 PM |
players = {game.Players:GetChildren().Name} for i,guis in pairs(game.ServerStorage.udontseethis.udontseethis:GetChildren()) do for v = #players, 10, 1 do guis.Text = players[i] print("done "..i) end end Error: String expected on line 4. help
-spooky- |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 06 Jan 2015 06:45 PM |
| guis.Text = players[i].Name |
|
|
| Report Abuse |
|
|
BowtieMod
|
  |
| Joined: 01 Apr 2013 |
| Total Posts: 804 |
|
|
| 06 Jan 2015 06:45 PM |
guis.Text = players[i].Name
Assign the player name, not the player |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 06:48 PM |
Helped a bit. Now it says: 6:47:08.607 - Players.Player.PlayerGui.mafiagui.mafiagui.Script:4: attempt to index field '?' (a nil value) still not sure.
Is it that I'm testing in Studio?
-spooky- |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 06:49 PM |
It's the same script, forgot to replace the name in the forum. Focus more on the index field '?' thing.
-spooky- |
|
|
| Report Abuse |
|
|
BowtieMod
|
  |
| Joined: 01 Apr 2013 |
| Total Posts: 804 |
|
|
| 06 Jan 2015 06:49 PM |
Just means that it tried to access a non-existant player
for v = #players, 10, 1 do
There may not be a player 10. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:00 PM |
local players = game.Players:GetPlayers() local guis = game.ServerStorage.udontseethis.udontseethis:GetChildren() for i, gui in pairs(guis) do for index, player in pairs(players) do gui.Text = player.Name end end
?
idk exactly what you are trying to do, but that might fix some problems |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Jan 2015 07:02 PM |
Did you guys not notice this...?
'players = {game.Players:GetChildren().Name}' |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:03 PM |
| I did, so I wrote a dif script. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:10 PM |
@Do
Thanks, that got past that problem. Will have to work a little more on it to edit it how i need to but it works.
-spooky- |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:12 PM |
Alright, I am still learning but I am pretty good with loops.
Test stuff out and if you run into a wall, come back. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:16 PM |
Alright, problem. For whatever reason the script isn't wanting to update the text on the textbuttons I have.
Here's the updated script.
local players = game.Players:GetPlayers() local guis = game.ServerStorage.mafiagui.mafiagui:GetChildren() for index, player in pairs(players) do for i, gui in pairs(guis) do if gui:IsA("TextButton") then gui.Text = player.Name print(player.Name) print(gui.Name) end end end
-spooky- |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2015 07:17 PM |
Prints all of the names.
-spooky- |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2015 06:15 PM |
I started over and am still having this problem. Might be easier to fix now.
local player = script.Parent local players = {game.Players:GetPlayers()} local guis = player.PlayerGui.mafiagui.mafiagui:GetChildren()
for i,gui in pairs(guis) do if players[gui.Name] then gui.Text = players[gui.Name] end end
The gui is named 1,2,3 etc
-spooky- |
|
|
| Report Abuse |
|
|