Advertisement
EconomicSerg

Sort of animated ROBLOX keycard door

Oct 21st, 2020
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. -- Add two parts into Workspace and name one "Door1" and the other"Door2"
  2. -- Add another part, make it look like a keycard
  3. -- Add a tool into StarterPack and name it "Keycard"
  4. -- Add a script into Door1 and type this
  5.  
  6. local Door1 = game.Workspace.Door1
  7. local Door2 = game.Workspace.Door2
  8.  
  9. -- You're going to make Door2 Transparency 1 and CanCollide false, or uncheckmarked
  10.  
  11. script.Parent.Touched:Connect(function(hit)
  12.     if hit.Parent.Name == "Keycard" then
  13.         Door1.Transparency = 1
  14.         Door2.Transparency = 0
  15.         Door1.CanCollide = false
  16.         Door2.CanCollide = true
  17.         wait(2)
  18.         Door1.Transparency = 0
  19.         Door2.Transparency = 1
  20.         Door1.CanCollide = true
  21.         Door2.CanCollide = false
  22.     end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement