Heyo! Could you share with us what you used to define the “Value” variable?
It is a server script inside of a part in workspace
--Plastic is the NumberValue
local Value = script.Parent.Plastic
Are you changing the value with a local script or a server script?
He said serverscript a reply ago.
I am changing the value with a serverscript
Value.Changed:Connect(function(V)
print(V)
end)
So I think this works.
Can you add a print right before the changed event, is it possible that the script never makes it to that line?
try to just define the value object but not the value itself, like local a = workspace.Value and then you can do a.Value.Changed:Connect(function() end) idk if it will work but give it a try
Question, how do you change value of the numbervalue to test if it works? Do you use a LuaSourceContainer object like Localscript/ServerScript or do you use the studio command bar or do you edit it directly from object browser in run mode?
It is getting to the line that the while true do
loop is at
Inside the while loop could you also add this line:
Value.Value += 1
I made a script that waits 10 seconds and then after that it changes the value
I see, and where is that script located?
Post the full script, there is probably an error.
The script is inside of workspace
First script You can also change the wait for how long between the number change.
while true do
script.Parent.Value = script.Parent.Value + 3
wait(3)
end
Second Script is
script.Parent.Changed:Connect(function(V)
print(V)
end)
Apparently It needed to be changed inside the same script first to notice anything was changing for some reason
Your other script probably was referencing the wrong value.
Change the first script with this
script.Parent.Changed:Connect(function(V)
print(V)
end)
while true do
script.Parent.Value = script.Parent.Value + 3
wait(3)
end
And disable second script, let me know if that worked.
What I can tell is one script is a LocalScript and the other one is a Script, and they’re wrong, or, you’re trying to use LocalScripts on workspace objects or something.