Advertisement
EconomicSerg

Simple ROBLOX Keycard script

Sep 11th, 2020 (edited)
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. -- Thanks for 100 views!!!!!
  2.  
  3.  
  4. -- Script by Alvinblox, just wanted to post this on pastebin.
  5. -- Make sure there is TWO ends
  6. -- Make a door, also make a keycard, name the keycard "Keycard", put a script into the door, and paste this
  7.  
  8. local waitime = 2 -- How long it takes before it turns to normal
  9.  
  10. script.Parent.Touched:Connect(function(hit) -- Hit function
  11.     if hit.Parent.Name == "Keycard" then -- If the Keycard hits the door
  12.         script.Parent.Transparency = 0.5 -- The door opening
  13.         script.Parent.CanCollide = false -- Going through the door
  14.         wait(waitime) -- Waits until it can close
  15.         script.Parent.Transparency = 0 -- The door closing
  16.         script.Parent.CanCollide = true -- You can no longer go through unless the Keycard touches it again
  17.     end -- An end
  18. end) -- An end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement