Add a check for a value?

Basically Im going to have a warn system and each warn you get will add a +1 to the intValue

How would I add a check for the server to check if you have 3 warns?

local value = -- reference
value.Changed:Connect(function()
  if value.Value == 3 then

  end
end)

Is that what you are asking for?

2 Likes

I believe so. Will that automatically check your value. Say you have been playing for 30 minutes and you get your final warn. Will that check that you have 3 warns?

That event will fire every time the value changes. If they were warned, the value goes up by 1, and that function will check if they have 3.

1 Like

The IntValue.Changed event passes the new value as the first parameter, so you can use that instead of doing value.Value.

1 Like