Advertisement
HowToRoblox

OpenDoorScript

Dec 1st, 2019
2,569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2.  
  3. local char = plr.Character
  4.  
  5. local door = script.Parent
  6.  
  7. local debounce = false
  8.  
  9. while wait() do
  10.     if plr.Badges > 1 then
  11.         local distance = (door.Position - char.HumanoidRootPart.Position).Magnitude
  12.        
  13.         if distance < 10 and debounce == false then
  14.            
  15.             debounce = true
  16.            
  17.             for i = 1,50 do
  18.                 wait()
  19.                 door.Transparency = door.Transparency + 0.02
  20.             end
  21.                
  22.         else
  23.            
  24.             for i = 1,50 do
  25.                 wait()
  26.                 door.Transparency = door.Transparency - 0.02
  27.             end
  28.            
  29.             debounce = true
  30.         end
  31.     end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement