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

Teleporting not working?

Asked by
dreamy67 135
10 years ago

When ever I try to teleport players to another area of the map, it teleports them way farther than their supposed to.

part = script.Parent
touching = false
part.Touched:connect(function(hit)
    human = hit.Parent:findFirstChild("Humanoid")
    player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
    if human and player and touching == false then
        touching = true
    local target = CFrame.new(58, 0.59, -221) 
    player.Character.Torso.CFrame = target + Vector3.new(58, 0.59, -221)
            touching = false
    end
end)

Answer this question