I’m trying to check if my boolean value is set to true whenever a certain Bindable Event fires and gets received.The problem is that I keep getting this error whenever it checks it in the if statement:
Sections Of My Script (Placed In ServerScriptService):
-- Where I declare the boolValue
local raceInProgress = ServerStorage.RacingSystemStorage.RaceInProgress
BindableRaceEnd.Event:Connect(function(PlayerThatTouched, PlayerName)
if raceInProgress.Value == true then -- Where the error happens
Any clue why this is happening, and how to fix it? Thanks for the help in advance.
Yes, I use it throughout the (rather large) script. In the other parts of the script I change the value from false to true, etc. and there’s no error. So I find it strange why it would error here and not elsewhere.
If you change the variable to true/false, and not its .Value property, that’d cause the error. Make sure it’s always referring to the BoolValue and never a boolean. (e.g., ctrl+f for “raceInProgress =”)
Ahhh thanks very much! I found out that in another part of the script, I was setting the variable to true/false, so it must’ve caused the error like you said. Sigh… that was a dumb error by me haha