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 7 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 7 years ago
01target = CFrame.new(0,0,0-- Position here
02 
03script.Parent.Touched:connect(function(hit)
04 
05    if hit.Parent then
06    humanoid = hit.Parent:FindFirstChild("Humanoid")
07    if humanoid then
08 
09      humanoid.Parent.HumanoidRootPart.CFrame = target + Vector3.new(0, 1, 0)
10end
11   end
12end)

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 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago
01debounce = true
02part = script.Parent
03part.Touched:Connect(function()
04    debounce = false
05    if part:FindFirstChild("Humanoid") ~= nil then
06        local plr = game.Players:GetPlayerFromCharacter(part) -- Prevents the possible NPC from touching this part
07        if plr then
08            humanoid = part:FindFirstChild("Humanoid")
09            if humanoid.RigType == Enum.HumanoidRigType.R6 then -- Check for R6
10                humanoid.Parent.Torso.CFrame = CFrame.new(Vector3.new(5,0,10)) -- Example position
11            elseif humanoid.RigType == Enum.HumanoidRigType.R15 then -- Check for R15
12                humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(5,0,10)) -- Again, another example position
13            end
14        end
15    end
16    wait(1)
17    debounce = true
18end)

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 — 7y
0
Change "part.Touched" to "game.Players.PlayerAdded" and modify the script accordingly. DeceptiveCaster 3761 — 7y
0
would you be able to answer with the edited script? tictac67 96 — 7y