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

What is wrong with this Teleporter Script?

Every time I touch the button that makes you teleport, It always says that vector3 isn't a member of Part. Can someone help me out?

Heres the script:

function Teleporter()
	script.Parent.vector3.new(workspace.SpawnLocation2.Position + Vector3.new(0,5,0))
	
	
end

script.Parent.Touched:connect(Teleporter)

1 answer

✓ Accepted answer

You din't write the script write. It should look like this.

function Teleport()
script.Parent.Position = Vector3.new(game.Workspace.SpawnLocation2.Position + Vector3.new(0, 5, 0))
end

--Or if you want to teleport the player.

function Teleport(Hit)
if Hit.Parent and Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent:MoveTo(game.Workspace.SpawnLocation2.Position + Vector3.new(0, 5, 0))
end
end

script.Parent.Touched:connect(function(Teleport)

2 comments

0

Right* Spelling and capitalization are important in code, so they should be worked on. simple typos can lead to hours of debugging. (a versus A)

0

Your connection line is wrong. It looks like you're almost doing an anonymous function, but "script.Parent.Touched:connect(Teleport)" will work fine.

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