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

Would these 2 work together?

Would this?

local p = game.Players:GetPlayers()
for i = 1, #p do

Work for this?

for i,v in pairs(game.Players:GetPlayers()) do
    v:MoveTo(Vector3.new(75.4, 326.9, -469.7))

1 answer

✓ Accepted answer

No, it wouldn't. i points to the index of the player, but you can't get instances by the index number. You will have to use for i,v pairs(game.Players:GetPlayers()) do.

EDIT: After some further research, I realized it actually is possible to make them work together: p[i] is the same in the first script as v is in the second script.

2 comments

0

How would I make it so the 2 could work together?

0

See my edited answer.

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