Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

What is wrong with this script?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

should be table.insert, not table.Insert

Ad
Log in to vote
1
Answered by 9 years ago

This should work.... :P:P TROLOLOL

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
9 years ago

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.

0
Oh yeah, I forgot that while loops need a wait, dumb me :P ScriptFusion 210 — 9y

Answer this question