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

I need to pairs 2 tables in this workspace backup script, How do I do that ?

Asked by 4 years ago
01print("Server backup by BrennoMaturino1 (I am from brazil)")
02 
03local ignore = {
04    --Exemplo: workspace.Rocket --[[-- AQUI VÃO OS MODELOS QUE DEVERÃO SER IGNORADOS --]]--
05 
06 
07    workspace.Lobby,
08    workspace.GameScripts,
09    workspace.Terrain
10    --workspace. --[[-- NOME DA INSTANCIA --]]--
11    --workspace. --[[-- NOME DA INSTANCIA --]]--
12    --workspace. --[[-- NOME DA INSTANCIA --]]--
13    --workspace. --[[-- NOME DA INSTANCIA --]]--
14}
15local instances = {} --Não mexa, aqui são armazenados os modelos do jogo com excessão os que devem ser ignorados
View all 72 lines...

I need to pairs workspace while i pairs the ignore table The ignore table not is ignoring the models, i need to synchronize the workspace and the ignore table

0
Yes, I know it would be difficult to do like that way, but I don't know any better way. User#32819 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You don't need to loop both of these tables, just loop one and use if statements to see if it's on the ignore table using ignore[1] to identify the position of the table.

01print("Server backup by BrennoMaturino1 (I am from brazil)")
02 
03local ignore = {
04    --Exemplo: workspace.Rocket --[[-- AQUI VÃO OS MODELOS QUE DEVERÃO SER IGNORADOS --]]--
05 
06 
07    workspace.Lobby,
08    workspace.GameScripts,
09    workspace.Terrain
10    --workspace. --[[-- NOME DA INSTANCIA --]]--
11    --workspace. --[[-- NOME DA INSTANCIA --]]--
12    --workspace. --[[-- NOME DA INSTANCIA --]]--
13    --workspace. --[[-- NOME DA INSTANCIA --]]--
14}
15local instances = {} --Não mexa, aqui são armazenados os modelos do jogo com excessão os que devem ser ignorados
View all 69 lines...

I hope this helped you!

0
Thanks for the reply and sorry for the delay, but I don't like doing it the way you did, because if I have a very large table, I will need a very large IF if and if I need to use a table.insert () as I will make this ? [Sorry for english mistakes, I am from Brazil] BrennoMaturino1 10 — 4y
Ad

Answer this question