Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to TP players like Dungeon Quest?

How would you make a party/teleportation system like dungeon quest?

2 comments

0

This is a request, this website is for questions you need help on not for requesting

0

^^^

2 answers

Hello!

First of all, you're not supposed to tell someone just DO THIS FOR ME.

Second of all, you should go search on ROBLOX Wiki and on YouTube about HumanoidRootPart and etc.

Finally, here's a step by step example of a code teleporting players with explications telling how this works and explaining the code. (SCRIPT, not LocalScript.). The activation of this script is when BoolValue Teleport is set to true. You can set it to true in many different ways.

local player = game.Players.LocalPlayer -- Define player

local char = player.Character -- Define char, short for character

local teleport_value = game.Workspace.TeleportBool -- Create a BoolValue in Workspace called TeleportBool

local teleport_to_part = game.Workspace.TeleportSpawn -- I used this fictionnal part as example, put the part you want the player to teleport to.

teleport_value.Changed:Connect(function() -- If the TeleportBool value has changed, do the code.


	if teleport_value == true then -- Check if TeleportBool became true, not false.

		char.HumanoidRootPart.CFrame = CFrame.new(teleport_to_part.Position) -- HumanoidRootPart is the part that everything is Welded to, so if that moves, then the whole body moves. The reason I didn't use Torso is because there are R15 bodies now.
		teleport_value = false -- No reason for teleport_value to be true, we want to be able to set it up later again.

	else -- If the teleport value changed to false, not true then

		print("False alert") -- You can remove the else and this too, just to make it easier to understand.


	end
end)


This should work. Reply if you still have any problems.

3 comments

0

This isn't how Dungeon Quest teleports. Dungeon quest uses TeleportService to teleport players to other places. This is teleporting the player's physical location.

0

How did you answer twice if you have a cooldown?

0

idk lag

Hello!

First of all, you're not supposed to tell someone just DO THIS FOR ME.

Second of all, you should go search on ROBLOX Wiki and on YouTube about HumanoidRootPart and etc.

Finally, here's a step by step example of a code teleporting players with explications telling how this works and explaining the code. (SCRIPT, not LocalScript.). The activation of this script is when BoolValue Teleport is set to true. You can set it to true in many different ways.

local player = game.Players.LocalPlayer -- Define player

local char = player.Character -- Define char, short for character

local teleport_value = game.Workspace.TeleportBool -- Create a BoolValue in Workspace called TeleportBool

local teleport_to_part = game.Workspace.TeleportSpawn -- I used this fictionnal part as example, put the part you want the player to teleport to.

teleport_value.Changed:Connect(function() -- If the TeleportBool value has changed, do the code.


	if teleport_value == true then -- Check if TeleportBool became true, not false.

		char.HumanoidRootPart.CFrame = CFrame.new(teleport_to_part.Position) -- HumanoidRootPart is the part that everything is Welded to, so if that moves, then the whole body moves. The reason I didn't use Torso is because there are R15 bodies now.
		teleport_value = false -- No reason for teleport_value to be true, we want to be able to set it up later again.

	else -- If the teleport value changed to false, not true then

		print("False alert") -- You can remove the else and this too, just to make it easier to understand.


	end
end)


This should work. Reply if you still have any problems.

This discussion is preserved as it was. New answers, comments, and votes are closed.