Forum
Scripts
How do i make a storage to store all player's data
How 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
Mami Tomoe: I think using Lua tables is better, but the problem is that I have to create a variable for the player's data. 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
Komo the Cat: You can't store data without variables, man XDDDD
1

Offline