How to make a model teleport to a player "me"

local me = script.Parent.Parent.Parent.PrimaryPart
    local part = script.Parent.Parent.hole
    local vol = 999
    local stop = 1
    local function move(step)
        local dis = (part.Position - me.Position).Magnitude
    if dis > step then
        part.CFrame = part.CFrame:Lerp(me.CFrame, step * vol/dis)
    end
    end
        
    
    

    while true do
        wait(0.1)

game:GetService("RunService").Stepped:Connect(function(time, step)
    move(step)
    end)
    end
    end

this moves it after me i found on a youtube video does anyone have a better way to teleports and not moves

@DEVLocalPlayer @ItzEthanPlayz_YT

local part = script.Parent.Parent.hole
local HRPpos = script.Parent.Parent.Parent.PrimaryPart

part:SetPrimaryPartCFrame(HRPpos.CFrame * CFrame.new(0,0,2))

What are you trying to achieve here?

im not sure about the parenting of the instances but hopefully this works.

local me = script.Parent.Parent.Parent.PrimaryPart
local model = script.Parent.Parent.hole
model:PivotTo(me.CFrame)

A few things:

  • Don’t create connections in a while loop. A connection to RunService basically is a loop already.
  • The step parameter is in units of time. Why do you compare the distance between the two characters to the time of each Step?
  • You should probably use Heartbeat instead of Stepped, since you aren’t doing something with physics and you don’t want to slow down your game.