local Can = true
local Open = false
Button = script.Parent

function Click()
	if Can then
		Can = false
		if Open == false then
			local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
			for i = 0,1,.1 do
				local cfm = script.Parent.Parent.PrimaryPart.CFrame:lerp(finish,i)
				script.Parent:SetPrimaryPartCFrame(cfm)
				wait()
			end
		end
		Open = true
	else
		Open = false
		local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
		for i = 0,1,.1 do
			local cfm = script.Parent.Parent.PrimaryPart.CFrame:Lerp(finish,i)
			script.Parent:SetPrimaryPartCFrame(cfm)
			wait()
		end
	end
	Can = true
end

4 comments

0

Lemme try something on your code.

0

I'm making a hole new model. I'll send you the link

0

Thank you.