workspace.TimeSurived:GetPropertyChangedSignal("Value"):Connect(function()
if workspace.TimeSurived.Value 40-60 then
--code here
end
end)
COMMUNITY QUESTION
Script when a value is in a range of numbers?
2 answers
"and" runs the code only if both requirements are met. So, it's checking if the value is greater than or equal to 40 AND is less than or equal to 60.
workspace.TimeSurived:GetPropertyChangedSignal("Value"):Connect(function()
if workspace.TimeSurived.Value >= 40 and workspace.TimeSurived.Value <= 60 then
--code here
end
end)
workspace.TimeSurived:GetPropertyChangedSignal("Value"):Connect(function()
local val = workspace.TimeSurived.Value
if val > 40 and val < 60 then
-- code here
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Do "if game.Workspace.TimeSurvived.Value >= 40 or game.Workspace.TimeSurvived.Value <= 60 then"