Can't seem to modify player.Character?

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

Try setting Player.Character on clientside and use SetNetworkOwner on serverside for the character you’re trying to set

If you are just trying to swap the characters, then I think it would be easier to use CharacterAppearance. See this article:

That’s what I was missing! Adding SetNetworkOwner() made it work, though I needed to set Player.Character on the server side, doing it on the client made nothing happen, other than setting their cameras

1 Like

This is definitely useful, will keep it in mind

What I was trying to achieve is not only to change their appearances though, I was trying to swap their positions and controls as well, basically like their souls swapped kind of thing

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.