Attempt to index number/boolean with "Value"

For some reason im getting this error
“Attempt to index number/boolean with “Value””

function startRound()

	events.FireStatus:FireAllClients()
	wait(1)
	pickRoles()

	if intermission.Value < 0 and intermission.Value > 0 then
		status.Value = "Something went wrong! [intermission value is less than 0] please try again later."
		return
	else
		onRound.Value = true
		round.Value = 150
		onIntermission.Value = false


		while onRound.Value == true do

			round.Value -= 1
			status.Value = "You have " .. round.Value .. " before the bombs are detonated"
			if round.Value == 0 then
				onRound.Value = false
				startIntermission()
			end
			wait(1)
		end
	end
end

It was all of a sudden, it was working fine until this happened

What line is it? If it’s from the "You have "..round.Value line it’s probably because round.Value is a number, so you need to convert it to a string to concatenate it. "Text Here"..tostring(round.Value).." more text here."

its where it says
onRound.Value = true

What exactly is onRound? [charlimit]

You can simplify:

if intermission.Value < 0 and intermission.Value > 0 then

to:

if intermission.Value ~= 0 then

:slight_smile:

1 Like

a bool value on replicated storage

Does your variable look something like this: onRound = game.ReplicatedStorage.MyValue.Value.

If so, it’s probably because you’ve already reference the value in the variable, so doing Value.Value makes no sense

the variable is
local onRound = game:GetService("ReplicatedStorage").OnRound

Hmm, somewhere else in the script you might have accidently said onRound = true (or false) without .Value which would make the whole variable = to true. Did you do this anywhere?

thanks, yes i had another function called “startintermission” and made the entire variable false. thank you!

1 Like