IntValue's Value not changing in Script when supposed to, any help?
So I'm making a stat system where certain stuff give you buffs, in this example the player gets a buff to the stat "Speed"
1 | function ChangeStat(char, Stat, amount) |
2 | game.Workspace.Data [ char.Name ] [ Stat ] .Value = amount + 1 |
3 | print (workspace.Data [ char.Name ] [ Stat ] .Name.. " " ..workspace.Data [ char.Name ] [ Stat ] .Value) |
6 | ChangeStat(char, "Speed" , -. 05 ) |
I've confirmed it locates the IntValue correctly, and if I print amount I get the correct output, but when I print the stat's Value after it should've been changed I always recieve whatever it was before, in this case 1 when it should be 0.95.
I could really use some help on this as it really confuses me.
Thank you in advance!