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)
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.
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.