I am making a script which will check if a BoolValue is true or false. I have tried making the script, but it is not working. It shows an error in the output too.
Here is the script:
local remote = game.ReplicatedStorage:WaitForChild("SimonSaysEditor", 100)
local start = game.ReplicatedStorage.Values.StartRound
local inter = game.ReplicatedStorage.Values.Intermission
function startChanged()
if start.Value == true then
wait(1)
start = false
local simon = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
remote:FireAllClients("The simon for this game is going to be " .. simon.Name .. "!")
wait(3)
remote:FireAllClients("", false)
simon.Team = game.Teams.Simon
wait(0.5)
simon:LoadCharacter()
local spectate = game.Teams.Spectators:GetPlayers()
wait(0.5)
for i,v in pairs(spectate) do
v.Team = game.Teams.Players
v:LoadCharacter()
end
wait()
inter.Value = true
end
end
start:GetPropertyChangedSignal("Value"):Connect(startChanged
Start is a Boolean value in Replicated Storage.
It shows this error in the output:
00:23:19.250 - ServerScriptService.StartRound:7: attempt to index upvalue 'start' (a boolean value)
The script works the first time but doesn't work 2nd time.
Please tell me how I can solve this problem. I have tried a lot but I am unable to make it work.

8 comments
Please post the full code. You never show where start is declared.
Done.
Why are you saying start["Value"].Value?
I have tried changing it to that but it is not working too.
I saw it on roblox developer forum.
And also the script works the first time but on the second time it doesn't work.
Please tell me what is the problem. Please.
All value objects have a Changed event do not use GetPropertyChangedSignal.