function onButtonClicked()
for i=29,-31,-1 do
wait() --the least amount of time that it can wait is one frame and there is no point looping it that fast anyway, you mine as well just set it to the end position.
script.Parent.Parent.Creator.Position = UDim2.new(0,500,0,i)
end
end
function close()
if script.Parent.Parent.Creator.Position == (0,500,0,29) then
script.Parent.MouseButton1Click:connect(onButtonClicked) -- here it all depends on what script.Parent is, although I am not sure of this working
end
end
script.Parent:connect(close) --No function connection here, you need a .Touched or somthing of that sort, .MouseButton1Click, .KeyDown, so on |