Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Workspace.Pad1.Touched:Connect(function(hit) -- When something touches, it connects to a function with hit in the argument.
- if hit.Parent:FindFirstChild("Humanoid") then -- Here we can check that the child here was a humanoid which touched.
- game.Workspace.Enterance.Wall1.CanCollide = false -- Then we make that the wall's cancollide get's false.
- hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position) -- Here this makes our character move to the StartPositions Position.
- game.Workspace.Enterance.BackWall1.CanCollide = false -- This makes the BackWall's enterance cancollide to false.
- wait(4) -- It waits 4 seconds.
- game.Workspace.Enterance.Wall1.CanCollide = true -- Changes Wall1's CanCollide to true.
- wait(0.1) -- Waits 0.1 seconds.
- game.Workspace.Enterance.BackWall1.CanCollide = true
- end
- end)
- game.Workspace.Pad2.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- game.Workspace.Enterance.Wall2.CanCollide = false
- hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position) -- Makes the humanoid which touched the part move to the startpositions position.
- game.Workspace.Enterance.BackWall2.CanCollide = false -- Changes CanCollide to false.
- wait(4) -- Waits 4 seconds.
- game.Workspace.Enterance.Wall2.CanCollide = true -- Changes CanCollide to true.
- wait(0.1) -- Sets a wait of 0.1 seconds.
- game.Workspace.Enterance.BackWall2.CanCollide = true -- Changes CanCollide to true.
- end
- end)
- game.Workspace.Pad3.Touched:Connect(function(hit) -- This does the exact same thing as on Pad1 and Pad2. I wont repeat everything agian.
- if hit.Parent:FindFirstChild("Humanoid") then
- game.Workspace.Enterance.Wall3.CanCollide = false
- hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position)
- game.Workspace.Enterance.BackWall3.CanCollide = false
- wait(4)
- game.Workspace.Enterance.Wall3.CanCollide = true
- wait(0.1)
- game.Workspace.Enterance.BackWall3.CanCollide = true
- end
- end)
Add Comment
Please, Sign In to add comment