local b = script.Parent
local guess = b.Parent.Guess
local nums = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
local plr = b.Parent.Parent.Parent.Parent
local newNum = nums[math.random(1, #nums)]
local round = 1
local submitted = false
local val = 1

b.MouseButton1Click:connect(function()
submitted = true
	if guess.Text == newNum then
		b.Parent["Yes/No"].Text = "Correct!"
		plr.Guesses.Value = plr.Guesses.Value + val
	else
		b.Parent["Yes/No"].Text = "Incorrect!"
		plr.Fails.Value = plr.Fails.Value + val
	end
end)

if submitted == true then
	val = 0
end

while true do
	wait(15)
	round = round + 1
	newNum = nums[math.random(1, #nums)]
	print(newNum)
	val = 1
end

All of that works but if I try and stop the changing of the values if the submitted is true it doesn't work. Help?

So I want to, basically, after they click once they can't click again, but when a new round starts, they can.

6 comments

0

I'm not sure where you're getting at. Where is the "if" statement you're concerned about at in the script overall? Is it within a code block? If so, can you post the code block?

0

its at the end of the post.

4

That's not what I mean. Where in your actual script is the "if" statement located?

0

^ It's not. Please post your entire code

0

You need to post the entire code, not just the if statement, so we know exactly where we're looking and what's causing the error.

0

the if statement provided at the end belongs on line 20, sorry.