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

Adding value script?

Like in a number value, how would you add numbers and subtract them? I tried this but It doesn't work:

local v = workspace.value
v.value + 1

So how do you add value?

1 answer

✓ Accepted answer

NumberValues have a .Value property. In order to add to them you need to do it like this:

local numberval = game:GetService'Workspace'.Value -- The numbervalue
numberval.Value = numberval.Value + 1  -- Adding to the value of the numbervalue

-- In order to add to any value, you need to make their value equal to their last value plus the new value Ex: local derp = 0 derp = derp + 1 

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