Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Teleportation of the players not working?

Thanks for your coming. What I am trying to do is making a portal that teleports the players, but when I run it, it does not work and return an Error saids:

“Torso is not a valid member of Model “willywillycow"

Here is my script:

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild(“Humanoid”) then
		hit.Parent.Character.Torso.CFrame = CFrame + Vector3.new(10,150,0)

How can I fix it?

2 comments

0

You dont have to do hit.Parent.Character since you already found the character, its just the parent of the humanoid, also, using humanoidrootpart would be more ffective since if the player is r15 then it wouldnt work cause Torso is not in r15, the torso is seperated into more parts, Another thing, I dont know much about CFrame but i dont think that you can add Vector3's to cframe.

1 answer

✓ Accepted answer

Here's a script I use.

function ontouch(hit)

	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

	if plr then

			hit.Parent.HumanoidRootPart.CFrame = CFrame.new(0,0,0)

		end
	end

script.Parent.Touched:Connect(ontouch)

This discussion is preserved as it was. New answers, comments, and votes are closed.