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

How would we move all players to multiple parts?

Asked by 5 years ago

I do not want every play teleporting to the same spot because they end up flinging everywhere.

I can not figure out how to spread them.

0
You could remove player-player collision? oftenz 367 — 5y
0
You could make a table that has multiple positions Synth_o 136 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

What about a table with vector3s and then use

Table[math.random(1,#Table)]

so you can put many positions and make the script do the job, I hope this can help you.

Ad
Log in to vote
0
Answered by
xEmmalyx 285 Moderation Voter
5 years ago
Edited 5 years ago

I can think of a couple solutions to your problem

Use positions which put the character above others

local position = Vector3.new(0,0,0)

for k,v in pairs(game.Players:GetChildren()) do
    if v.Character then
        v.Character:MoveTo(position) 
    end
end

Randomize them to teleport in the general area of the position

local cframe = CFrame.new(0,0,0)

for k,v in pairs(game.Players:GetChildren()) do
    if v.Character then
        local a = math.random(-10,10)
        local b = math.random(-10,10)
        v.Character.HumanoidRootPart.CFrame = cframe * CFrame.new(a,0,b)
    end
end

CFrame them higher and higher

local cframe = CFrame.new(0,0,0)

for k,v in pairs(game.Players:GetChildren()) do
    if v.Character then
        v.Character.HumanoidRootPart.CFrame = cframe * CFrame.new(0,k*5,0)
    end
end

I haven't tested these so I apologize as I am working on another project

Answer this question