#Need help thinking of how I should make a system

1 messages · Page 1 of 1 (latest)

rain current
#

So I just got to the point where I need stats for each of my players and I just realized I have zero clue how to implement stats like a strength stat or speed stat or how to increase it over time like when the player levels up. I honestly just need a few pointers on how I can start setting this up

compact panther
#

Lots of design choices here but my mind starts with the idea of tables

velvet shoal
#

save data to datastore only when player is leaving the game or server is shutting down or something like that

#

so the proggress is saved

#

when player joins load their data from datastore and store it in a temporary table on server side and validate all changes to it to prevent exploits

#

make changes to that temporary table for example adding level to a player

#

and when player leaves save that temporary table in datastore

#

as for changing the stats you could make a function for that, it will be easy to use in different scripts too if you use modulescript

jolly wraithBOT
#

studio** You are now Level 1! **studio

velvet shoal
#

yea idk

rain current
#

Okay i see ill try using a module script with tables that can keep track of playerstats and if im correct a module script can speak to others so i can just use for damage the new module script inside my attacking module right?

compact panther
#

Yes you can require a module script so you can maybe use a function to add some type of data