Issue I am having is if vs is greater than Timebroken it should print(“false”)
but it doesn’t.
I checked if the loop works by adding print(thing) and it prints true. No errors either, but if I rejoin and vs is greater than Timebroken then it would print false. This is a script in serverscriptservice.
local thing = false
local vs = workspace.Values.Value
thing = true
while thing == true do
task.wait()
print(thing)
if workspace.Value:GetAttribute("TimeBroken") <= vs then
print("false")
thing = false
local thing = true
local vs = workspace.Values
while thing do
task.wait(0.1)
print(thing)
if workspace.Value:GetAttribute("TimeBroken") <= vs.Value then
print("false")
thing = false
end
end
Idk i reworded it because I wasnt sure what your code was trying to do, so I would assume this is correct.
You would have to have another part of the script set the vs value to be less then timebroken in order for “thing” to be set to false
To print false if vs is greater than TimeBroken. The issue I am having is that when vs is greater than timebroken it does not print false unless if I leave and rejoin then it will.
how often is the timebroken attribute updated?
if you want the loop to continuously runinstead of only running once thing is set to false, then you can have a empty condition. for example:
while true do
task.wait(0.1)
print(thing)
if workspace.Value:GetAttribute("TimeBroken") <= vs.Value then
print("false")
thing = false
end
end
Is there another script in your game that modifies this value? If so, this would be the culprit because this is a static value that is only referenced once in your script.