--The Script isnt working help me :( door = script.Parent.Parent.Door function onClicked() if door.open.Value == false then door.open.Value = true door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) door.CFrame = CFrame.new(door.Position + Vector3.new(0,0.1,0)) wait(0.1) end end script.Parent.ClickDetector.MouseClick:connect (onClicked)
You should be using a for
loop for a job like this.
function onClicked() door = script.Parent.Parent.Door if door.open.Value == false then door.open.Value = true -- Might not be 10, but I don't want to count all those lines for i = 1, 10 do door.CFrame = CFrame.new(door.Position + Vector3.new(0, 0.1, 0)) wait(0.1) end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
With regards to your original question, what specifically isn't working, and what error does the script provide?