Advertisement
Gui2879

Scripts - Roblox Studio tutorial #3 - GamingDev

Jul 5th, 2020
2,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. Fecha (Portão):
  2.  
  3. function onClicked()
  4.     script.Parent.Parent.Door.Transparency= 0
  5.     script.Parent.Parent.Door.CanCollide= true
  6. end
  7. script.Parent.ClickDetector.MouseClick:Connect(onClicked)
  8.  
  9.  
  10.  
  11.  
  12.  
  13. Fecha (Barreira invisível):
  14.  
  15. function onClicked()
  16.     script.Parent.Parent.Door1.Transparency= 1
  17.     script.Parent.Parent.Door1.CanCollide= true
  18. end
  19. script.Parent.ClickDetector.MouseClick:Connect(onClicked)
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. Abre (Portão):
  28.  
  29. function onClicked()
  30.     script.Parent.Parent.Door.Transparency= 1
  31.     script.Parent.Parent.Door.CanCollide= false
  32. end
  33. script.Parent.ClickDetector.MouseClick:Connect(onClicked)
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. Abre (Barreira invisível):
  41.  
  42. function onClicked()
  43.     script.Parent.Parent.Door1.Transparency= 1
  44.     script.Parent.Parent.Door1.CanCollide= false
  45. end
  46. script.Parent.ClickDetector.MouseClick:Connect(onClicked)
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. Porta com keycard:
  58.  
  59. script.Parent.Touched:Connect(function(p)
  60. if p.Parent.Name == "Cartão" then --Coloque aqui o nome da tool (!!!EXATAMENTE!!!)
  61. script.Parent.Transparency = 1
  62. script.Parent.CanCollide = false
  63. wait(3) --Mude o número para o tempo que deseja que a porta fique aberta após detectar o cartão!
  64. script.Parent.Transparency = 0
  65. script.Parent.CanCollide = true
  66. end
  67. end)
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. NOTA: COPIE EXATAMENTE ESSAS SCRIPTS! COPE E COLE (CTRL C, CTRL V)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement