✓ Accepted answer
I'm pretty sure this should work.
Basically all you needed was a function to run on the event of clicking the button, not once you start the game in Roblox Studio.
local button = workspace.Button
local click = button.ClickDetector
click.MouseClick:Connect(function()
print("pressButton")
wait(10)
print("TEXT")
end)
Another thing you could have done if you wanted the wait to stop right when the player pressed the button you could do
local button = workspace.Button
local click = button.ClickDetector
print("pressButton")
click.MouseClick:Connect(function()
print("Text")
To sum it up, the first one will wait 10 seconds when the player pressed the button while the second one will print Text once the player clicks the button
If I helped remember to mark my answer as "answered the question" it'll help both of us