I’m looking for a simple way I can teleport a player to a cframe/general position vector without (or a mitigated) risk of just tripping over and falling in place.
This is a bit circumstantial and depends on where and how they’re teleported, but right now I really only know of directly moving the root part somewhere and crossing my fingers they don’t trip.
local Room = script.Parent.Parent.Parent
local Config = Room.Configuration
local CD = script.Parent
function onClicked(plr)
-- into the room ref
plr.Character.Humanoid.WalkSpeed = 0
CD.MaxActivationDistance = 0
Room.TP2.ClickDetector.MaxActivationDistance = 0
script.open:Play()
wait(0.5) -- delay
CD.MaxActivationDistance = 5
Room.TP2.ClickDetector.MaxActivationDistance = 5
script.close:Play()
plr.Character.HumanoidRootPart.CFrame = CFrame.new(Room.TpLocationIn.Position)
wait(0.5)
plr.Character.Humanoid.WalkSpeed = 16
end
script.Parent.mouseClick:connect(onClicked)
The teleport location is slightly elevated if that helps, if anything just a way to ensure a lesser chance of faulty teleporting.
local Pad2 = game.Workspace.Pad1
script.Parent.Touched:Connect(function(touchPart)
if touchPart and touchPart.Parent and touchPart.Parent.Humanoid and touchPart.Parent.currentlyTeleporting.Value == false then
local Character = touchPart.Parent
local teleportLocation = CFrame.new(Pad2.CFrame.X, Pad2.CFrame.Y + 5, Pad2.CFrame.Z)
Character:SetPrimaryPartCFrame(teleportLocation)
local teleportingValue = Character.currentlyTeleporting
teleportingValue.Value = true
wait(3)
teleportingValue.Value = false
end
end)
I guess this teleporting script will help you out.
local Pad1 = game.Workspace.Pad2
script.Parent.Touched:Connect(function(touchPart)
if touchPart and touchPart.Parent and touchPart.Parent.Humanoid and touchPart.Parent.currentlyTeleporting.Value == false then
local Character = touchPart.Parent
local teleportLocation = CFrame.new(Pad2.CFrame.X, Pad2.CFrame.Y + 5, Pad2.CFrame.Z)
Character:SetPrimaryPartCFrame(teleportLocation)
local teleportingValue = Character.currentlyTeleporting
teleportingValue.Value = true
wait(3)
teleportingValue.Value = false
end
end)
This should be Pad 2 script.
You can even change the second’s, instead of 3 you can put 2 or someother number you want, but you need to do it in both the scripts, not only in one.
You can simply call the instance method “:SetStateEnabed()” through/on the humanoid instance in order to enabled/disable the various humanoid states for that particular humanoid.