i want the loop to break once the value has reached 900
but its not breaking and keeps adding
while wait(1) do
for _, player in pairs(game.Players:GetPlayers()) do
local Quest = player:FindFirstChild("Quest")
if Quest then
local playTimeQuest = Quest:FindFirstChild("playTime")
if playTimeQuest then
playTimeQuest.Value += 1
if playTimeQuest.Value >= 900 then
break
end
end
end
end
end
It isn’t even what you might be doing wrong, it is what you’re doing around. Try to fix the problem on your own first, instead of posting less than a minute after.
What are you trying to accomplish with this? Are you trying to stop adding value to a certain player when they reach the max value? The description is too vague