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

How to TP players like Dungeon Quest? [closed]

Asked by 5 years ago

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

0
This is a request, this website is for questions you need help on not for requesting User#30241 0 — 5y
0
^^^ NexoKami 12 — 5y

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?

2 answers

Log in to vote
0
Answered by 5 years ago

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.

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. proqrammed 285 — 5y
0
How did you answer twice if you have a cooldown? hiimgoodpack 2009 — 5y
0
idk lag lolol1901 28 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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.