Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

how do you add an amount on to a value?

Asked by 5 months ago

for a leaderstat im trying to add for a simualtor how do you do it

2 answers

Log in to vote
0
Answered by
Qub_lex 201 Moderation Voter
5 months ago

.Value should be pretty straightforward. It gets the value of, well, a value. You can use any math function on values. It was literally that simple.

0
yes but how cjkizzy286 24 — 5mo
0
You have values in your leaderstats, right? Qub_lex 201 — 5mo
0
yes cjkizzy286 24 — 5mo
0
The .Value property gets the number of those values. Qub_lex 201 — 5mo
Ad
Log in to vote
0
Answered by 5 months ago

let me show you a example of adding value

local value = -- Your value instance
value.Value = 100 -- This will set the value to 100
value.Value = value.Value + 200 -- Add to your value, now it should be 300

Notice:

local Value = script.Parent.Value
Value = 100 -- wrong, don't do this, it won't work
local Value = script.Parent
Value.Value = 1-- - Yep

Hope that helped

Answer this question