Hello I’m trying to swap a player’s character with another player, I searched up how to do this and it seems simply setting the player’s character to another rig works for them, but nothing is happening when I do it for some reason.
So far I’ve been able to clone both player’s characters, and I’ve set their player.Character to their corresponding clone, but nothing happens…
Here is my code:
local Players = game.Players:GetPlayers()
local randomPlayer
local randomPlayerChar
repeat
randomPlayer = Players[math.random(1, #Players)]
task.wait()
until randomPlayer.Character ~= nil and randomPlayer.Character:FindFirstChild("Humanoid")
randomPlayerChar = randomPlayer.Character
char.Archivable = true
randomPlayerChar.Archivable = true
local clone1 = char:Clone()
local clone2 = randomPlayerChar:Clone()
char.Archivable = false
randomPlayerChar.Archivable = false
char = clone2
randomPlayerChar = clone1
clone1:PivotTo(char.PrimaryPart.CFrame)
clone2:PivotTo(randomPlayerChar.PrimaryPart.CFrame)
clone1.Parent = workspace
clone2.Parent = workspace
char is the Character of the player that triggered the RemoteEvent that started this script, and randomPlayerChar is the character of a randomly picked player in the server