Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] Why won't this server Script detect a change in a NumberValue?

I have a server script that sets 4 NumberValues in Workspace as variables. The NumberValues are initially 0, then are changed with a LocalScript. In game, I see that the NumberValues are not 0 anymore, but if I put a yield on the server script that waits until the NumberValues are changed, it never stops.

Server Script:

local id1 = game.Workspace.MoveId1
local id2 = game.Workspace.MoveId2
local id3 = game.Workspace.MoveId3
local id4 = game.Workspace.MoveId4

repeat wait() until id1.Value ~= 0

print("IDs changed")

Thanks in advance, DesertusX

1 answer

I think you should make a function:

id1.Changed:Connect(function()
print("Hello World")

1 comment

0

Thank you, but it turned out the problem was that the NumberValues were changed in a LocalScript while the other script was server-sided.

This discussion is preserved as it was. New answers, comments, and votes are closed.