function onClick()
script.Parent.Text = "Clean Workspace"
wait(1)
script.Parent.Text = "Cleaning Workspace."
wait(1)
script.Parent.Text = "Cleaning Workspace.."
wait(1)
script.Parent.Text = "Cleaning Workspace..."
wait(1)
script.Parent.Text = "Done Cleaning Workspace(50)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(49)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(48)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(47)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(46)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(45)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(44)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(43)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(42)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(41)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(40)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(39)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(38)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(37)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(36)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(35)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(34)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(33)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(32)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(31)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(30)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(29)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(28)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(27)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(26)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(25)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(24)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(23)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(22)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(21)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(20)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(19)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(18)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(17)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(16)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(15)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(14)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(13)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(12)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(11)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(10)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(9)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(8)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(7)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(6)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(5)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(4)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(3)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(2)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace(1)"
wait(1)
script.Parent.Text = "Done Cleaning Workspace"
wait(1)
script.Parent.Text = "Clean Workspace"
wait(1)
end
script.Parent.MouseButton1Click:connect(onClick)
How do I make this shorter and how to i make it so that they have to wait 56 seconds before they can click it again or can click it after the text Clean Workspace shows again? I am very new to lua coding. THX

1 comment
On top of ScriptGuider's answer you could also have used variables so you wouldn't have to type out script.Parent so mmuch