How to transform into another player

Hello , I’m doing the tool that will allow to control other player if the mouse pointed to player and you press “X” Button . I made some script in the tool you can see it here :
``local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Ghost = math.random(player,1)
local UIS = game:GetService(“UserInputService”)
local RepStorage = game:GetService(“ReplicatedStorage”)

local function GetPlayer()

if mouse.target ~= "HumanoidRootPart" and script.Parent.Parent.Equipped == true then
	Input.InputBegun.KeyCode = Enum.KeyCode.X
	if player == Ghost then
		local Target = mouse.target.Parent:Copy()
		local PlayerCharacter = player.Character:Copy()
		PlayerCharacter.Parent = RepStorage
		Target.Parent = player
		wait(0.1)
		player.Character:Destroy()
		Target.Name = player.Name
		print("Well well well , we are on half way")
	else
		if mouse.target ~= nil or "part" and script.Parent.Parent.Equipped == true then
			Input.InputBegun.KeyCode = Enum.KeyCode.X
			if player == Ghost then
				local RepCharacter =	RepStorage:FindFirstChild(player.Name):Copy()
				RepCharacter.Parent = player
				RepCharacter.Name = player.Name
				print("Final line of script")
			end
		end
end

I tried it but it doesn’t work at all and I tried to do it for 3 days so I wanted to ask for help from more advenced developers , Thanks !

1 Like

Have you looked into using HumanoidDescription? It would be a much easier way to transform a player’s characters into someone else’s character.

2 Likes

No I didn’t use that but it looks like something useful , thanks !

1 Like