I am in a situation where I need this for loop to change a couple string values. I can't find anywhere online where it says it is possible, but I can't see anywhere that it's impossible. Here's my script. Can anybody help.
01 | local RS = game.ReplicatedStorage |
02 | local Open 1 v 1 Server = RS.Open 1 v 1 Server |
03 |
04 | local P 1 = fifthFrame.Player 1 |
05 | local P 2 = fifthFrame.Player 2 |
06 | local children = Open 1 v 1 Server.Players:GetChildren() |
07 | for i = 2 , #children do |
08 | P 1. PlayerName.Value = i, children.Name |
09 | P 2. PlayerName.Value = i, children.Name |
10 | end |
Of course it's possible. However, the method you're doing it makes no sense.
1 | P 1. PlayerName.Value = i, children.Name |
What are you trying to do here? First of all, children doesn't HAVE a Name
attribute, and you can't set a string value to two things (i, children.Name
)
If you're trying to set it to the value of i
concatenated with the name OF the value associated with i
in the children array, you would make it
1 | P 1. PlayerName.Value = i .. children [ i ] .Name |