Rank’s value is originally set as 0, and since x isn’t set to 1 or 3, it stayed 0 (default value), therefore it doesn’t add money (or add 0 money since you are multiplying a number with 0). All you need is set rank.Value to 1 or 2 instead of 0
local rank = Instance.new("IntValue")
rank.Name = "Rank"
rank.Value = 0
rank.Parent = player.stats
local x = Instance.new("IntValue")
if rank.Value == 0 then
x.Value = 1
elseif rank.Value == 1 then
x.Value = 3
end
while wait(1) do
money.Value += 1 * MUpgrade.Value * rebs.Value + 1 * x.Value
end
end)
Looks like MUpgrade.vale == 1, rebs.Value == 1, and x.Value == 1 so “1x1x1==1”
Why don’t you try to set MUpgrade.value to 2, rebs.Value to 2, x.Value to 2, and see if the money is set to 8, to check the rest of your script.
You could use an if statement and do something like
if MUpgrade.value<=1 and rebs.Value<=1 and x.Value<=1 then
money.Value == whatever you want it to be
else
money.Value += 1 * MUpgrade.Value * rebs.Value + 1 * x.Value
end
I am not sure exactly how much money you want the player to start with, or what exactly your plans are for the stats, but if you told me more about how you want the player to start, I could probably give more specific help.
It’s probably because you are adding the values on a local script, which won’t be changed on the server. If this is the case, try to use remote events and change it on the server, along with that can you show the local script that handles the button? (IF you are changing the values on the local script)