Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does a value count as changed when it is loaded from data?

Asked by 5 years ago

For example if a level value is loaded on player added and a script is supposed to fire when the level value is changed, will the script fire or not?

0
The script will fire if it's connected to the event .Changed (or you can use GetPropertyChangedSignal alternatively), whenever the value you specify is changed it will fire and run the code inside the function. YabaDabaD0O 505 — 5y
0
Oh.. How would I avoid extra points for example if I wanted a stat value to be added every level and it would save on data, how would I avoid the stat value being doubled if a player joins again? xxXTimeXxx 101 — 5y
1
I'm confused on what you mean doubled. If you're adding a value every level then it shouldn't be doubling at all. YabaDabaD0O 505 — 5y
0
I want to make the stat value be added every level and make it save on player leave, which is run by a change function ( on level changed). If the stat saves on player leave (for example lvl 50 = 50 stat points) when the player joins again another 50 stat points will be added to the stats since the stat point will be loaded and it will connect on level changed. How would I avoid that? :O xxXTimeXxx 101 — 5y
View all comments (2 more)
0
If you're taking advantage of GetAsync / SetAsync properly you don't have to avoid anything you've proposed, just save and load the data. What are you getting at? Goulstem 8144 — 5y
0
Oh okay thanks, I'm still not in that part yet so i'll update you when my game gets to that point xxXTimeXxx 101 — 5y

Answer this question