Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is wrong with this script?

This script keeps crashing my RBXStudio.

players = {}
while true do
for i,v in pairs(game.Players:GetPlayers()) do
table.Insert(players, v)
end
end

Why?

3 answers

✓ Accepted answer

should be table.insert, not table.Insert

You need to add a wait() to the while loop, eg

players = {}
while true do
for i,v in pairs(game.Players:GetPlayers()) do
table.Insert(players, v)
end
wait()--add a number with any value in seconds.
end

No problem.

1 comment

0

Oh yeah, I forgot that while loops need a wait, dumb me :P

This discussion is preserved as it was. New answers, comments, and votes are closed.