Leaderboard script dont find value

darnga

This order changes value in replicatedstorage when player is International white team.

zaluts

Actually it works good according to situation

BUT

This guy. that should print “gaaaaaaa…” when the value is 1111, is not working…

Why? I know value in replicatedstorage can effect all script and all function…
that was wrong?

It only checks the value once, you’d need to make it check every time the value is changed via the Changed event, which for ValueBases only will fire when the value property changes

You could do something like this

local function changedEvent(newValue)
    if newValue == 1111 then
        print("gaaaaaaaaaaaaaaaaaaaaaaaansuuuuuuuuuuuuuu")
    end
end
changedEvent(levaral.Value)
levaral.Changed:Connect(changedEvent)
1 Like

Is newValue = levaral.Value ?
Can I delete 6 line and change all newValue to levaral.Value?

In the case when we call the function by itself, we give it the current value of levaral, when connected the changed event, it’ll always get the new value levaral is set to, so for what you asked, yes newValue = levaral.Value

1 Like