Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleport part to another part doesn't work as planned, why?

Asked by 3 years ago

Hello! I am trying to make a part that you touch to teleport you, it works in Roblox Studio, but in game, it doesn't teleport the player. Please, if you know any alternatives, or you know how to fix it, please tell me.

local CollisionPart = script.Parent
local pospart = game.Workspace.RockyPitstop.PosPart
local Debounce = false

CollisionPart.Touched:Connect(function(hit)
    if not Debounce == true then
        Debounce = true
        print("Its working")
        if hit.Parent:FindFirstChild("HumanoidRootPart") then
            hit.Parent.HumanoidRootPart.Position = pospart.Position
            wait(3)
            Debounce = false
        end
    end
end)
0
change position to CFrame supercoolboy8804 114 — 3y
0
also add a "WaitForChild()" for your variables, scripts load before objects so that could also be an issue supercoolboy8804 114 — 3y

Answer this question