I am making a confirm button, where when you click a button it asks you to confirm, and after 3 seconds it goes back to normal. How would I detect if the player has clicked again in the 3 seconds from the first click?
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Text = "Confirm?"
script.Parent.Parent.Info.Text = "Would you like to spend 100 Credits for 100 Time?"
script.Parent.Parent.Info.Visible = true
-- I think somewhere here is where it would go
wait(3)
script.Parent.Text = "100 Time"
script.Parent.Parent.Info.Text = ""
script.Parent.Parent.Info.Visible = false
end)
Thanks!

4 comments
But how would I detect when the mouse was clicked after the first click, and making sure that if they click after the 3 seconds it doesn't purchase without doing the confirm thing?
So what I mean is when the player clicks the button, it asks them to confirm, and if they didn't click it when it said confirm it resets after 3 seconds, back to 100 time etc.
That is the debounce, if the debounce is true then they clicked twice
So if they click it again, if the debounce is true it will say script.Parent.Text = "100 time"