local word = math.random(1,10)
local secretword = word
local TextBox = script.Parent
local label = game.StarterGui.ScreenGui.TextLabel

print(word)

if TextBox.Focused == true then
	if TextBox.Text == word then
	 print("Guess is right")
		label.Visible = true
	end
end

if TextBox.Focused == false then
	wait(1)
	TextBox.Text = (' ')
end

Errors = nothing

I want the text to clear after 1-second passes of the textbox not being focused, and for 'Guess is right' to print and label becomes visible but for some reason that is not working. Can anyone help?