I want to make this delay stop working when the value of CanWork is changed to false
But whenever the value is changed to false, the system still runs once again
CanWork.Changed:Connect(function()
if CanWork.Value == true then
local EmpregoFind = Emprego.Value
local Salario = Turnos.Trabalhos[EmpregoFind].Salario
while true do
if CanWork.Value == true then
delay(DelaySalario,function()
print("Deleyed")
Money += Salario[1]
wait()
ValorText.Text = "R$ "..tostring(Money)
end)
wait()
else
break
end
end
end
end)