This is what I have, I don’t know if it will work yet because I haven’t tested yet.
function SeperatePlayers()
local AllPlayers = Players:GetPlayers()
local TenPercentPlayers = AllPlayers * 0.1
-- Teleport 10% in one spot, the other 90% in another
end
How would I teleport 10% in one spot, and the other 90% to another spot?
Side note, would this make it random, because I want this to be random.
function SeperatePlayers()
local AllPlayers = Players:GetPlayers()
local TenPercentPlayers = AllPlayers / 10
-- Teleport 10% in one spot, the other 90% in another
end
Something like this?
Also, if there was a random amount of people, like 14 people for example, wouldn’t that be 1.4 people, which is impossible. Or would math.round help with that?
Though this isn’t a great way of doing it, you could just choose the team by randomize and then send people on each teams and stop sending to the other teams once it knows it has 10 people in it.
Although that would work, that isn’t really my goal. I want 10% of the total players in the server to one side, and teleport the other 90% to the other side.
But mine would be safer from bugs as how you stated on how it would be 1.4 if it were to be 14 players and so math.round wouldn’t fix that as 1.4 would round to 1. I think, math.floor might help something with that issue.