Is there a way to do this? I need to teleport a player to a place in my map.
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
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.
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?