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

Would these 2 work together?

Asked by 10 years ago

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

Log in to vote
0
Answered by
gskw 1046 Moderation Voter
10 years ago

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.

0
How would I make it so the 2 could work together? MUSHR0OM 0 — 10y
0
See my edited answer. gskw 1046 — 10y
Ad

Answer this question