Advertisement
OEAgamer1

How to make a Key Door in Roblox Studio

Mar 10th, 2025
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local part = script.Parent
  2. local isOpen = false
  3.  
  4. part.Touched:Connect(function(hit)
  5.     local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
  6.     local key = plr and plr.Character:FindFirstChild("Key")
  7.    
  8.     if key and not isOpen then
  9.         isOpen = true
  10.         part.Transparency, part.CanCollide = 0.5, false
  11.         wait(2.5)
  12.         part.Transparency, part.CanCollide = 0, true
  13.         isOpen = false
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement