oonqi

button door code

Dec 19th, 2021
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. script 1
  2. put this inside button
  3. --
  4. local blockName = "Block"
  5. local door = game.Workspace.Door
  6. script.Parent.Touched:Connect(function(part)
  7. if part.Name == blockName then
  8. door.CanCollide = false
  9. door.Transparency = 1
  10. end
  11. end)
  12.  
  13.  
  14.  
  15.  
  16.  
  17. script 2
  18. put this inside block
  19. --
  20. local Button = workspace.Button
  21. local Sound = game.Workspace.Sound
  22.  
  23. script.Parent.Touched:Connect(function(hit)
  24. if hit == Button then
  25. Sound:Play()
  26. script:Destroy()
  27. end
  28. end)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment