English How to save tables

3 replies
Goto Page
To the start Previous 1 Next To the start
15.10.15 05:38:41 am
Up
The Smoker
User
Offline Off
Hello, I'm developing a script, however I am newbie in LUA.
This script has two factions, but I want the player to create his own faction with the "f_create <name>". Okay, I did it.
Factions are on a table and when I create a new faction with the "f_create" the script creates a sub-table with all the information. Look at this.

Spoiler >


My question is how can I save the sub-tables that players create, so that when the server open again they are loaded.
15.10.15 05:59:17 am
Up
eledah
User
Offline Off
[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]
15.10.15 01:47:23 pm
Up
Talented Doge
User
Offline Off
Save by using their USGN, table[USGN] for example. And table[USGN][1] loads the first one.
Talented Doge
16.10.15 05:19:28 am
Up
Louie
User
Offline Off
Try using io.open, io.close, io.write. Save the values of the tables to a file then load those values again the next time the server starts.
No system is safe.
To the start Previous 1 Next To the start