Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local part = script.Parent.Parent
- local Main = script.Parent.Parent.Part
- local OtweenInfo = TweenInfo.new(
- 2, -- Length of an interpolation
- Enum.EasingStyle.Linear, -- Easing Style of the interpolation
- Enum.EasingDirection.Out, -- Easing Direction of the interpolation
- 0, -- Number of times the sequence will be repeated
- false, -- Should the sequence play in reverse as well?
- 0 -- Delay between each interpolation (including reverse)
- )
- -- A dictionary of property names, and the values they are trying to reach in the interpolation:
- local OpropertyGoals =
- {
- part:SetPrimaryPartCFrame( Main.CFrame + Vector3.new(-8,0,0))
- }
- -- Create the "Tween" object that represents the playback of this interpolation
- local open = TweenService:Create(Main,OtweenInfo,OpropertyGoals)
- -- Play the interpolation:
- --------------------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------------------
- local TweenService = game:GetService("TweenService")
- local part = script.Parent.Parent
- local Main = script.Parent
- local CtweenInfo = TweenInfo.new(
- 2, -- Length of an interpolation
- Enum.EasingStyle.Linear, -- Easing Style of the interpolation
- Enum.EasingDirection.Out, -- Easing Direction of the interpolation
- 0, -- Number of times the sequence will be repeated
- false, -- Should the sequence play in reverse as well?
- 0 -- Delay between each interpolation (including reverse)
- )
- -- A dictionary of property names, and the values they are trying to reach in the interpolation:
- local CpropertyGoals =
- {
- part:SetPrimaryPartCFrame( Main.CFrame - Vector3.new(0,0,0))
- }
- -- Create the "Tween" object that represents the playback of this interpolation
- local Close = TweenService:Create(Main,CtweenInfo,CpropertyGoals)
- -- Play the interpolation:
- Open = false
- Moving = false
- script.Parent.Parent.Parent.Button.ClickDetector.MouseClick:connect(function()
- if Open == false and Moving == false then
- Moving = true
- Open = true
- open:Play()
- wait(2)
- Moving = false
- elseif Open == true and Moving == false then
- Moving = true
- Open = false
- Close:Play()
- wait(2)
- Moving = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement