Can anyone help me? I'm trying to make a poster flip display and I'm using a door script but the script doesn't work right. Can anyone help me?

local cf = script.Parent.CFrame
function onClicked()
	if script.IsOpened.Value == false and script.IsOpening.Value == false then
		script.IsOpening.Value = true
		for i = 1,16 do
			script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.18) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
			wait(0.01)
		end
		script.IsOpening.Value = false
		script.IsOpened.Value = true
	elseif script.IsOpened.Value == true and script.IsOpening.Value == false then
		script.IsOpening.Value = true
		for i = 1,16 do
			script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
			wait(0.01)
		end
		script.IsOpening.Value = false
		script.IsOpened.Value = false
		script.Parent.CFrame = cf
		script.CloseSound:Play()
	end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

while true do
	wait(15)
	if script.IsOpened.Value == true then
		script.IsOpening.Value = true
		for i = 1,16 do
			script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
			wait(0.01)
		end
		script.IsOpening.Value = false
		script.IsOpened.Value = false
		script.Parent.CFrame = cf
		script.CloseSound:Play()
	end
end

2 comments

0

I suggest following the wiki. Have you started the script, or do you know where to start? If so, could you post your code?

0

Okay, here's the script. I'm trying to make a poster flip display, so that's why I'm using a door to but it's doesn't work. D: