Forum
CS2D Scripts How do i make a storage to store all player's dataHow do i make a storage to store all player's data
4 replies 1
Write to save, read to load.
You can write it in many formats such as but not limited to:
CSV: Easy and fast, but limited to basic variables
Json: Harder, universal, slowest
Pure Lua (table): Slow but somewhat easy to implement
Ex :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Variable(s) -- local dataPlayer = {} local dataPlayer.amPlayer = {} -- Hook(s) -- addhook("join","j_func") addhook("leave","l_func") -- Function(s) -- function j_func(id) dataPlayer.amPlayer[id] = 0 end function l_func(id) dataPlayer.amPlayer[id] = nil end
1