the code that you have made is a bit wrong because you made a variable which accepts a string which is formatted like: “string”.
if you want to check if algo is false then change it to local algo = false
also about the event, touched event is used for when character touches a part.
when variable starts with “local”: it should be on the top of your code.
i’ve modified your code so it would be simple to read (you can run that!):
local Algo = false -- Boolean (false/true)
local function Deal()
Algo = true -- Algo is now true
print("Algo is now "..Algo.."! Yipee") -- This function outputs string (basically, prints) that has value from boolean Algo in developer console (F9)
end
script.Touched:Connect(function()
Deal() -- Call a function to set Aglo to true
if Algo == false then -- Checks if Algo is certainly false (however, function changed it to true lol)
print("Algo was false all the time!") -- Printing if Algo was false
else -- Runs another part of the code if Algo is something else
print("Algo was true all the time!") -- Printing if Algo was true
end
end)