Buzzy

Loading...

Buzzy

Register

Roblox Studio Tips - May 28, 2021

How to Make A Teleporter On Roblox Studio

1

Buzzy Beth

@buzzygamesbeth

  • let’s make a teleporter
  • grab two parts
  • i’ll change the color so we don’t getconfused
  • we want to teleport from the red part to the green part
  • we’re going to label our red part starttp and our green part ntp which will be referenced in our script
  • add a script to the starttp part which is the red part for me
  • we’ll write our variables here and then create a function that will execute ontouched where if a humanoid is touching the red part then the player will be teleported to the green part so we’re using an if and then statement here
  • we’ll call our function at the end of the code to make sure it’ll be executed
  • and we’re done! come join our discord for the full script and a community full of creators! link is down below have fun creating bye
local part = script.Parent
local tpPart = game.Workspace.EndTP

local function name(otherpart)
	
	local character = otherpart.Parent
	local humanoid = character:FindFirstChildWhichIsA("Humanoid")
	if humanoid then
		character.LowerTorso.CFrame = tpPart.CFrame + Vector3.new(0, 1, 0)
		
	end
end

part.Touched:Connect(name)