I did some searching to try and find a solution but there was nothing so I will create a thread here. I was wondering how I would go about splitting 10 players into 5 separate arenas, when someone dies in that arena, they are respawned in another arena, however I do not want them to fight the same opponents every time so they can learn the team they are fighting against. Just wondering if I could have a code idea on how to do it with a small explanation. Thank you! A picture of the 5 warmup arenas below. Notes: They are already split into 2 teams.
I’m not sure if this would be the most effecient way but I’d probably use a bunch of tables to split the players up then tables of players they’ve played against, and if they’re in a certain table they’ll spawn in a certain arena where it wouldn’t be possible for players who they’ve played against to spawn in the same arena. If there aren’t any other solutions I’ll come back later and write some code for it.
I don’t want them to face the same opponent after just facing them, I don’t mind if they fought someone in the past, just not the most recent player. Appreciate the early reply though!
Maybe you could set a variable that finds the players name, and then when you re-shuffle the players you can check if the player’s name is equal to the previous match’s one. Just a rough idea, but this can somewhat help you.
The problem with that, is that the players will die at different times which may be hard to keep up with.
Maybe you could do it in a localscript which fires a remote event carrying both player’s ID? And from there you can check if they are the same and fire a function that finds 2 empty arenas (bool value, if its empty or not) and from there it can teleport them to the respective zones.
I wouldn’t need a localscript to do that as I can just locate both players on the server and track them that way. With the bool value thing, I have already got that in place actually but I just haven’t scripted it yet. I think I have an idea on how I want to layout my tables. Thank you!
Good luck on your project! I hope everything goes well.
Thread is still open to solutions, for if others need this for similar use cases and to get more ideas and tweak what I am currently doing.
This doesn’t really seem possible imo, you either put the other player into waiting or just make them play with the same player again. I’d choose the 2nd option if I were you
Yeah that’s what I realised while making it, will stick to the second option.
local players = game:GetService("Players")
local playerList = players:GetChildren()
local teleportList = {teleport1, teleport2, teleport3, teleport4, teleport5}
for i, player in pairs(playerList) do
local character = player.Character
local HMR = character:WaitForChild("HumanoidRootPart")
HMR.CFrame = teleportList[i].CFrame
end
I believe this is about as simple as it can be.
I did something sort of similar to this, thank you for chipping into the discussion.