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

Teleport specific player to point in map? [closed]

Asked by 6 years ago

Is there a way to do this? I need to teleport a player to a place in my map.

Closed as Not Constructive by BlackOrange3343, DeceptiveCaster, Amiaa16, User#20388, Axceed_Xlr, and theCJarmy7

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 6 years ago
target = CFrame.new(0,0,0)  -- Position here

script.Parent.Touched:connect(function(hit)

    if hit.Parent then
    humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid then

      humanoid.Parent.HumanoidRootPart.CFrame = target + Vector3.new(0, 1, 0)
end
   end
end)

This is a .Touched teleport. For more information check out the roblox wiki - https://wiki.roblox.com/index.php?title=Teleporting_Within_a_Place

0
what are you talking about DeceptiveCaster 3761 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
debounce = true
part = script.Parent
part.Touched:Connect(function()
    debounce = false
    if part:FindFirstChild("Humanoid") ~= nil then
        local plr = game.Players:GetPlayerFromCharacter(part) -- Prevents the possible NPC from touching this part
        if plr then
            humanoid = part:FindFirstChild("Humanoid")
            if humanoid.RigType == Enum.HumanoidRigType.R6 then -- Check for R6
                humanoid.Parent.Torso.CFrame = CFrame.new(Vector3.new(5,0,10)) -- Example position
            elseif humanoid.RigType == Enum.HumanoidRigType.R15 then -- Check for R15
                humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(5,0,10)) -- Again, another example position
            end
        end
    end
    wait(1)
    debounce = true
end)

Notice lines 1,4,6,7,9,10,11,12,16 and 17. ROBLOXAIN2 forgot about that.

0
I want it to teleport the player when they join tictac67 96 — 6y
0
Change "part.Touched" to "game.Players.PlayerAdded" and modify the script accordingly. DeceptiveCaster 3761 — 6y
0
would you be able to answer with the edited script? tictac67 96 — 6y