This is not working. I need it in a function but when I change the string value in game.workspace this won't change
function example()
data = game.Workspace.Numb
while data.Value == 0 do
print("same value")
wait(1)
end
print("value = 1")
end
example()
Please help

11 comments
Drop the
.Valuefromdata, set it withdata.Value = ..., and don't mark posts as "Urgent" in the future.sorry I don't get it
Line 2 should be
data = game.Workspace.Numb, and like 3 should bewhile data.Value == 0 do.If you do
data = game.Workspace.Numb.Value, data is set to literally the value of Numb, rather than being a reference to the field. To do what you're doing, you need it to be a reference to the field, rather than an absolute value.I changed it but it still did not work
it's because data is not = to 0
so the while loop stops, and "same value" does not print
You don't need a reference to the property. Just directly access the property.
same value prints but value = 1 does not print
incapaxian can you type the full code for me please thanks
Directly accessing the property is still a reference to the property.