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

TP to a brick?

I know how to use co-ordinates to TP, but how to TP to a model without them?

2 answers

✓ Accepted answer

I use the :MoveTo() function when I teleport players.

I'm not sure how reliable it is, but I like it.

ROBLOX Wiki MoveTo

Ex:

t1=script.Parent

t2=game.Workspace.Tele2--Change this to the name of the part you want the player to be moved to

debounce=false

t1.Touched:connect(function(hit)--Fires if someone touched.

if debounce==false then--Is it cooling down?

debounce=true--No, not cooling down, but it is now.

if hit:FindFirstChild("Humanoid") then -- Checks to make sure it isn't a random brick or anything

hit.Parent:MoveTo(t2.Position,t2)--Moves it to the bricks position

wait(5)--Change this to whatever you want--Cooldown time

debounce=false

end--Ends the if , checking the humanoid

end--Ends the debounce If 
end)--Ends the touched function

I added debounce, so it doesn't mess up anything.

Was off the top of my head. +1 if it helped though.

I can tell you how to TP to a brick.

tp1 = script.Parent
tp2 = game.Workspace.PartYouWantToTeleportPlayerTo

tp1.Touched:connect(function(hit)
	humanoid = hit.Parent.Humanoid
	if (humanoid ~= nil) then
		torso = humanoid.Parent.Torso
		torso.CFrame = tp2.CFrame
	end
end)

1 comment

0

The error checking in this doesn't work. 1) Check for hit.Parent first. 2) Define humanoid as hit.Parent:FindFirstChild("Humanoid") or the check on snippet line 6 is worthless

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