Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ts = game:GetService("TweenService")
- local pps = game:GetService("ProximityPromptService")
- local drawer = script.Parent
- local prompt = script.Parent.Prompt
- local tweenInfo = TweenInfo.new(
- 0.5,
- Enum.EasingStyle.Exponential,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local open = ts:Create(drawer,tweenInfo,{Position = script.Parent.Parent.Target.Position})
- local close = ts:Create(drawer,tweenInfo,{Position = script.Parent.Parent.Drawer.Position})
- prompt.Triggered:Connect(function()
- if prompt.ActionText == "Open" then
- open:Play()
- script.Parent["Door Opening"]:Play()
- prompt.ActionText = "Close"
- else
- close:Play()
- script.Parent["Door Close"]:Play()
- prompt.ActionText = "Open"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement