We are not supposed to supply you with a script. Please try, and we can help you out on your issues. You wonβt learn without trying! ;))
Just try on your own next time.
local Door1 = game.Workspace.Part1 --define the location of part1
local Door2 = game.Workspace.Part2 --define the location of part2
local debounce = false
Door1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not debounce then
debounce = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
wait(2)
hit.Parent.HumanoidRootPart.CFrame = Door2.CFrame
wait(5)
debounce = false
end
end
end
end)
Door2.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not debounce then
debounce = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
wait(2)
hit.Parent.HumanoidRootPart.CFrame = Door1.CFrame
wait(5)
debounce = false
end
end
end
end)