How would you make a party/teleportation system like dungeon quest?
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.
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.
Closed as Not Constructive by hiimgoodpack and Leamir
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?