How would i make a teleport brick that teleports player to a location

i am kinda new to the teleport stuff, what i need is when player touches the brick, the player goes to a specific location of x,y and z

You can Make A Part And put it Inside Workspace
Now You can Call that Part Anything Such As TeleportLocation

Now You Need to Add A LocalScript inside Starter Player β†’ StarterCharacterScripts

local Brick = game.Workspace.Brick -- Define the Part which will be Touched
local FinalPosition = game.Workspace.TeleportLocation -- Define the Part which we Added

local Debounce = false 
local Character = game.Players.LocalPlayer.Character

Brick.Touched:Connect(function(Hit)
    if Hit.Parent.Name == Character.Name and Debounce == false then 
      Debounce = true
      Character.UpperTorso.CFrame = FinalPosition.CFrame -- UpperTorso Is for R15 
      wait(1)
      Debounce = false
  end
end)
1 Like

how would i do it with like positions not parts

You can Simply Set the Position of the UpperTorso to A New Position.
Such As β†’

local Brick = game.Workspace.Brick -- Define the Part which will be Touched

local Debounce = false 
local Character = game.Players.LocalPlayer.Character

Brick.Touched:Connect(function(Hit)
    if Hit.Parent.Name == Character.Name and Debounce == false then 
      Debounce = true
       Character.UpperTorso.CFrame = CFrame.new(0,0,0) -- Position
      wait(1)
      Debounce = false
  end
end)
1 Like

You can also use :MoveTo() I think.

1 Like

Well Yea that Might work aswell

Though this topic has already been solved I think this is not the most appropriate way to do it.
Upper Torso is only compatible for R15 in which case you need to add a if statement to check what the character type is and change according to that.
Humanoid Root Part’s CFrame is what you should be changing, which is compatible for both R15 and R6 and the best part is that you can there is an in-built function for the humanoid Root part to change its CFrame.
so the formatting should be somewhat like this

    local part = workspace.Part
    part.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
            local character = hit.Parent
            character:SetPrimaryPartCFrame(where_you_want_the_player_to_tp)
        end
    end)

@foxnoobkite the solution Yt_Forceman has provided you with is definitely gonna work but with R15 only so incase you are using R6 you should avoid it.
Hope this helps both

5 Likes