Advertisement
Anukun_Lucifer

DrawerScript

Apr 15th, 2023
1,261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | Gaming | 0 0
  1. local ts = game:GetService("TweenService")
  2. local pps = game:GetService("ProximityPromptService")
  3.  
  4. local drawer = script.Parent
  5. local prompt = script.Parent.Prompt
  6.  
  7. local tweenInfo = TweenInfo.new(
  8.     0.5,
  9.     Enum.EasingStyle.Exponential,
  10.     Enum.EasingDirection.Out,
  11.     0,
  12.     false,
  13.     0
  14. )
  15.  
  16. local open = ts:Create(drawer,tweenInfo,{Position = script.Parent.Parent.Target.Position})
  17. local close = ts:Create(drawer,tweenInfo,{Position = script.Parent.Parent.Drawer.Position})
  18.  
  19. prompt.Triggered:Connect(function()
  20.     if prompt.ActionText == "Open" then
  21.         open:Play()
  22.         script.Parent["Door Opening"]:Play()
  23.         prompt.ActionText = "Close"
  24.     else
  25.         close:Play()
  26.         script.Parent["Door Close"]:Play()
  27.         prompt.ActionText = "Open"
  28.     end
  29. end)
Tags: Roblox Doors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement