I want to have a function respawn 2 players at the first spawnlocation in the game. If a player leaves they lose the match, but the problem is that LoadCharacter also stops the script because they aren’t in the world.
I’ve tried checking with if statements so the script won’t try to load their character, but it never worked.
Here is the function I am using.
local function matchOver(player, w, l)
do
Match = false
Winner.Value = w.Name
Loser.Value = l.Name
ShowWinner:FireAllClients(player,Winner,Loser)
wait(5)
w.RespawnLocation = spawnloc l.RespawnLocation = spawnloc
w:LoadCharacter() l:LoadCharacter()
List[1] = nil
List[2] = nil
Winner.Value = ""
Loser.Value = ""
Round.Value = 0
Countdown = 3
Return:FireAllClients()
end
end