#Leaderstats ignoring subtraction of a value
23 messages · Page 1 of 1 (latest)
It can't be
cant be local or server?
It can't be client-sided (local)
The changes you make to the player's leaderstats won't replicate
why is that? the collectable coins work just fine
Read this webpage
Ive read a portion of it and the interaction is a server to client interaction
Your code does the following:
- Subtract
costfromPlayer/leaderstats/Coins - Load the previous recorded state of the player's coins
- Update the record to the new state of
Players/leaderstats/Coins - Overwrite the current state of
Player/leaderstats/Coinsto the previous state
The fourth operation is why you don't see the subtraction being made
You shouldn't be loading or saving the data in the first place
Not should the cost of something be defined in a ScreenGui
Replicated storage? thats where all of the other values i have stored are
** You are now Level 2! **
if this helps this is a part of the screen gui its what updates the cost
ok
I moved all both cost values to replicated storage and have them changed in another script which looks like this (this is a server script)
I also edited the og script and for some reason the cost2 value changes but when it is asked to print the coins it prints 3047 which was my coins before the subtraction