Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

IntValue.Changed not working through server script?

Asked by 4 years ago

This is not working and someone please help!

while wait() do
    local test1 = script.Parent
    test1.Parent.test2.Value.Changed:connect(function(c)
        print(c)
    end)
end
0
If you're trying to change the IntValue from a local script, changed won't fire because clients (Localscripts) can't actually change anything on the server for security reasons. whenallthepigsfly 541 — 4y

1 answer

Log in to vote
0
Answered by
174gb 290 Moderation Voter
4 years ago
Edited 4 years ago

You don't need make a loop to check if changed.

And in line 3 you using IntValue.Value.Changed. But it must be IntValue.Changed like this:

  local test1 = script.Parent
  test1.Parent.test2.Changed:connect(function()
    --Code here
  end)

And i dont know if you test2 is inside of test1. if test2 is inside of test1 then

  local test1 = script.Parent
  test1.test2.Changed:connect(function()
    --Code here
  end)

Or if your test2 isn't inside test1

  local test1 = script.Parent
  test1.Parent.test2.Changed:connect(function()
    --Code here
  end)
0
I tried the code and it does not work ;( billybobpumpkin 0 — 4y
Ad

Answer this question