Today, I was testing and creating a new code for an upcoming project, but, the whole studio crashed when I tested a specific for
loop within the Commands Bar. I do not know why it crashes like this, but it crashes every time I run it. This is the code;
local Table = { "Player1", "Player2", "Player3" } for i, v in pairs, Table do print(i, v) end
There's not much more I can explain sadly, only that it crashes when I use it. :(
-EDIT-
The purpose of why I coded the for loop like this was because I was curious on something; "I've seen 'for v in next, Table do', and 'for i, v in pairs (Table) do', so what happens if I set them up oppositely?" After setting up the code like this, it crashed when I ran it, thus my Question.
-EDIT2-
I just tested this code;
local Table = { "Player1", "Player2", "Player3" } for i, v in next (Table) do print(i, v) end
But it only resulted in an error. Very interesting..
-EDIT3-
I took Smrt's Answer into account and used a wait
function, and it returned function: 0EDC2EB8 table: 0EFAD730
, repeatedly spamming it into the Output box. Why is this?
I recommend you to add "wait ()"