Ducksneedhelp1

Entering Script

Dec 24th, 2020 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | None | 0 0
  1. game.Workspace.Pad1.Touched:Connect(function(hit) -- When something touches, it connects to a function with hit in the argument.
  2.     if hit.Parent:FindFirstChild("Humanoid") then -- Here we can check that the child here was a humanoid which touched.
  3.         game.Workspace.Enterance.Wall1.CanCollide = false -- Then we make that the wall's cancollide get's false.
  4.         hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position) -- Here this makes our character move to the StartPositions Position.
  5.         game.Workspace.Enterance.BackWall1.CanCollide = false -- This makes the BackWall's enterance cancollide to false.
  6.         wait(4) -- It waits 4 seconds.
  7.         game.Workspace.Enterance.Wall1.CanCollide = true -- Changes Wall1's CanCollide to true.
  8.         wait(0.1) -- Waits 0.1 seconds.
  9.         game.Workspace.Enterance.BackWall1.CanCollide = true
  10.     end
  11.        
  12.    
  13. end)
  14.  
  15. game.Workspace.Pad2.Touched:Connect(function(hit)
  16.     if hit.Parent:FindFirstChild("Humanoid") then
  17.         game.Workspace.Enterance.Wall2.CanCollide = false
  18.         hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position) -- Makes the humanoid which touched the part move to the startpositions position.
  19.         game.Workspace.Enterance.BackWall2.CanCollide = false -- Changes CanCollide to false.
  20.         wait(4) -- Waits 4 seconds.
  21.         game.Workspace.Enterance.Wall2.CanCollide = true -- Changes CanCollide to true.
  22.         wait(0.1) -- Sets a wait of 0.1 seconds.
  23.         game.Workspace.Enterance.BackWall2.CanCollide = true -- Changes CanCollide to true.
  24.     end
  25. end)
  26.  
  27.  
  28. game.Workspace.Pad3.Touched:Connect(function(hit) -- This does the exact same thing as on Pad1 and Pad2. I wont repeat everything agian.
  29.     if hit.Parent:FindFirstChild("Humanoid") then
  30.         game.Workspace.Enterance.Wall3.CanCollide = false
  31.         hit.Parent.Humanoid:MoveTo(game.Workspace.StartPosition.Position)
  32.         game.Workspace.Enterance.BackWall3.CanCollide = false
  33.         wait(4)
  34.         game.Workspace.Enterance.Wall3.CanCollide = true
  35.         wait(0.1)
  36.         game.Workspace.Enterance.BackWall3.CanCollide = true
  37.     end
  38. end)
  39.  
Add Comment
Please, Sign In to add comment