Hi 27starghost, I will show you a bunch of codes and describe each of them to you.
So, you want to start with Teleportation Process.
!!!!!!!!!!!!!!!!!I know that this isn't what you've asked for but it still might help you.!!!!!!!!!!!!!!!
Make sure to put 2 parts in your Workspace inside ROBLOX Studio with the size of: 4, 12.57, 5.3, and put the option CanCollide inside Properties of Both parts to false.
Name them, "Teleporter1" and "Teleporter2".
Here's an image on how should that look: https://imgur.com/a/prqXC2D
First of all, you need to know how to get Character from the "Normal Script".
(In this case, we are going to use hit.Parent)
Here's an example:
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
end)
Well, that was a code on how to get a character from "Normal Script".
Now we need to learn how to actually Teleport player from Part A to Part B!
(In this case, we are gonna be using SetPrimaryPartCFrame)
SetPrimaryPartCFrame will teleport the Model's Primary Part, in this case the Player Model already has PrimaryPart which is HumanoidRootPart.
Here's an example:
local ExitPart = game.Workspace:WaitForChild("Teleporter2")
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
Character:SetPrimarPartyCFrame(CFrame.new(ExitPart.Position))
end)
So, now when we learned how to Teleport player from place A to place B, we need to finish the script!
The script for Teleporter1 will be:
(Put this in a normal script inside a Part called "Teleporter1" which you've created earlier.)
local ExitPart = game.Workspace:WaitForChild("Teleporter2")
local debounce = 1
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
if Character:FindFirstChild("Humanoid") ~= nil and debounce == 1 then
debounce = 0
Character:SetPrimarPartyCFrame(CFrame.new(ExitPart.Position))
end
debounce = 1
end)
And the script for Teleporter2 will be:
(Put this in a normal script inside a Part called "Teleporter2" which you've created earlier.)
local ExitPart = game.Workspace:WaitForChild("Teleporter1")
local debounce = 1
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
if Character:FindFirstChild("Humanoid") ~= nil and debounce == 1 then
debounce = 0
Character:SetPrimarPartyCFrame(CFrame.new(ExitPart.Position))
end
debounce = 1
end)
So, this was something basic on how to make teleport script from Part A to Part B, I hope that this will help you even a bit.
I wish you a luck in your scripting career.
Have a good day mate.
1 comment
I completely forgot I made this post and to check back on it, thank you so much!