I attempted to make this function that ready's 2 randomly chosen players to fight:
local function readyduelers(dueler)
dueler.Character:MoveTo(spawn1.Position)
local swordclone = sword:Clone()
swordclone.Parent = dueler.Backpack
dueler.Character.Humanoid.WalkSpeed = 0
end
The code I used to choose the players and call the function:
_G.duelers = {}
local players = game.Players:GetPlayers()
local dueler1 = players[math.random(1, #players)]
repeat dueler2 = players[math.random(1, #players)] until dueler2 ~= dueler1
table.insert(_G.duelers, dueler1.Name)
table.insert(_G.duelers, dueler2.Name)
readyduelers(dueler1, dueler2)
The problem is, it's only teleporting player 1, even though I did "readyduelers(dueler1, dueler2)". I'm not sure how to fix this and any help is appreciated.
