local s = script.Parent
local Debounce = false
s.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil and Debounce == false then
Debounce = true
coroutine.wrap(function()
Debounce = false
task.wait(.1)
hit.Parent.LowerTorso.CFrame = game.Workspace.SpawnLocation.CFrame
end)()
end
end)
When i touch the teleport part it teleports me to it more than once and glitches
local s = script.Parent
local Debounce = false
s.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
hit.Parent.HumanoidRootPart.CFrame = game.Workspace.SpawnLocation.CFrame
end
end)
The problem with this is its registering my legs as two seperate touches so teleports me twice
s.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
hit.Parent.LowerTorso.CFrame = game.Workspace.SpawnLocation.CFrame
end)
end
end)
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
hit.Parent.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame + Vector3.new(0,10,0)
end
end)
local part = script.Parent
local deb = false
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) and not deb then
deb = true
hit.Parent.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame + Vector3.new(0,10,0)
wait(0.2)
deb = false
end
end)
Now it won’t run twice. Just add a debounce to stop that.
local part = script.Parent
local Debounce = true
part.Touched:Connect(function(hit)
if Debounce then
if hit.Parent:FindFirstChild("Humanoid") then
Debounce = false
hit.Parent.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame + Vector3.new(0,5,0)
wait(0.1)
Debounce = true
end
end
end)
If can make teleport pad for obby.
example teleport to tag on group
local part = script.Parent
local tele = script.Parent.Parent.Tag
local Debounce = true
part.Touched:Connect(function(hit)
if Debounce then
if hit.Parent:FindFirstChild("Humanoid") then
Debounce = false
hit.Parent.HumanoidRootPart.CFrame = tele.CFrame + Vector3.new(0,5,0)
wait(0.1)
Debounce = true
end
end
end)