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

Someone help me make a working teleport pad that teleport you to another part of the map? [Answered]

I Have Tried Multiple Times Teleporting The Player piece by piece but it keeps killing them how do i fix this?

1 answer

If you want too move models such characters, player models etc, it is recommended to use :MoveTo(Vector3.new(0,50,0)) But what model do we want to move? Lets say you have a localscript inside the player then

game.Players.LocalPlayer.Character:MoveTo(Vector3.new(0,50,))--This will move them too the
--top of the map
--You can also do this

If you want teleport pad, then use this

--In workspace you have a pad called TP1 and another Pad named "TP2", then
--Inside of a script inside TP1 pad
script.Parent.Touched:connect(function(hit)
	local char = hit.Parent
	local h = char:FindFirstChild("Humanoid")
	if h then
		char:MoveTo(game.Workspace.TP2.Position)
	end
end)--This will move the player when the player touches TP1, and then it will tp to TP2

So what we are doing is that we using the event "Touched" and when the TP1 is touched, the parameter "hit" will come to help us if its a player, so we do char = hit.Parent so it gets the parent of the hit part which is the player model itself, then we do char:FindFirstChild("Humanoid"), so in the model we are looking for a humanoid, if there is not a humanoid, it will return nil and the "if" statement will check if its a humanoid, if its not the FindFirstChild will return nil, or false, because nil = false, but nil is a value that does not contain any value, anyway, the if statement will check if its a humanoid, if it is then we grab the model and use :MoveTo(), inside the "()" we use the workspace TP2s position, which is a Vector3 Value already, so we can do :MoveTo(game.Workspace.TP2.Position, so it will move the model to that position, so what we just did we took game.Workspace.TP2.Position`s Vector3 Value, but we dont need to write anything more in the () because its already a Vector3 Value

1 comment

0

thx

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