Teleports my character to the morph charcacter. What? BIG Problem

So, I am making a game like piggy and want to teleport the killer to the black room. The floor of the black room is a morph part. It morphs the player into the killer. The thing is, after morphing, it teleports the player to the morph character (which is located in the workspace). It correctly morphs the player but, like I said, it teleports them. Here is my script:

local pad = script.Parent
local characterName = "Dummy"
local character = pad.Parent:WaitForChild(characterName)
local old = script.Parent.KIller

local debounce = true
pad.Touched:Connect(function(obj)
	local plr = game.Players:GetPlayerFromCharacter(obj.Parent)
	if plr and debounce == true then
		debounce = false

		local charClone = character:Clone()
		charClone.Name = plr.Name
		plr.Character = charClone

		local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
		local plrRoot = obj.Parent:FindFirstChild("HumanoidRootPart") or obj.Parent:FindFirstChild("Torso")

		if rootPart and plrRoot and plr.Name ~= old.Value then
			rootPart.CFrame = plrRoot.CFrame
		else
			warn("Player Already Morphed!")
		end
		
		old.Value = plr.Name

		charClone.Parent = workspace

		wait(.5)
		debounce = true
	end
end)

1 Like

you could try to keep teleporting the player in the correct position until it is there

But then they could not move in the black room.

ok so
it teleports instantly to the main game?
but u want it to stay in the black room?

No. After everyone has voted on the map, it chooses a random killer, and teleports them to the black room like in piggy. However, after teleporting them to the black room, they get teleported to the morph character. Which I do not want.

try checking if the morph character is anchored or welded to something

are all the parts welding together?

It is not. The problem has to be within the script above. I just do not know what it is.

The limbs of the morph are welded, yes.

so which is rootpart and plrRoot?

rootPart is the morph root part and plrRoot is the players’ character root part

are you really sure the script is the problem?
try making all the parts of the morph massless so when teleporting the player it can be teleported aswell

or how about try teleporting the morph model after failed teleporting the player

I am sorry but I do not understand. The morph and teleport work fine. Except, after the morph happens, it teleports the player to the morph character. I will make a video and show you what I mean.

1 Like

robloxapp-20210511-1553198.wmv (1.0 MB)

Sorry about the lag. I find it annoying

Couldn’t you just remove this line…? Or add a wait(30) before the Touched event begins to fire

I’m a bit confuzzled on looking at the video here

1 Like

I could try that. Sorry the video is laggy

I actually got it working. Thanks.