This is what I've tried..
script.Parent.OpenButton.ClickDetector:OnClick() script.Parent.Door.Size = 20, 15, 0.6 wait(1) script.Parent.Door.Size = 20, 14, 0.6 wait(1) script.Parent.Door.Size = 20, 13, 0.6
etc. Any ideas?
You have no connection lines, and Size is a Vector3 value meaning when you set it equal to something, it has to be a Vector3 value:
script.Parent.OpenButton.ClickDetector.MouseClick:connect(function() -- Simpler way to use functions and connection lines script.Parent.Door.Size = Vector3.new(20,15,0.6) --Assigning a new Vector3 value to size wait(1) --Waiting one second script.Parent.Door.Size = Vector3.new(20,14,0.6) --Again wait(1) --Again script.Parent.Door.Size = Vector3.new(20,13,0.6) --Yet again end) -- Parenthesis closes the connection line and end ends the function
theres not much wrong with your code except your connection line try this
function openButton() script.Parent.Parent.Size = 20, 15, 0.6 -- i change door to parent wait(1) script.Parent.Parent.Size = 20, 14, 0.6 --im assuming script is child of click detector which is child of door wait(1) script.Parent.Parent.Size = 20, 13, 0.6 end script.Parent.MouseClick:connect(openButton)
this should work
put this script as child of ClickDetector
script.Parent.MouseClick:connect(function(click) if click then script.Parent.Parent.Size = Vector3.new(20,15,0.6) wait(1) script.Parent.Parent.Size = Vector3.new(20,14,0.6) wait(1) script.Parent.Parent.Size = Vector3.new(20,13,0.6) end end)