I need to pairs 2 tables in this workspace backup script, How do I do that ?
Asked by
4 years ago Edited 4 years ago
I'm from Brazil, sorry for the English mistakes
01 | print ( "Server backup by BrennoMaturino1 (I am from brazil)" ) |
08 | workspace.GameScripts, |
17 | function PlayerJoined(player) |
18 | player.CharacterAdded:Connect( function () |
19 | if table.find(ignore, player.Character) = = nil then |
20 | table.insert(ignore, player.Character) |
22 | warn( "O character do jogador: " ..player.Name.. " Foi adcionado mas já está na tabela" ) |
27 | function ClearTable(tbl, IsInstance) |
28 | if IsInstance = = true then |
29 | for number in pairs (tbl:GetChildren()) do |
30 | table.remove(instances, number) |
33 | for number in pairs (tbl) do |
34 | table.remove(instances, number) |
39 | function CloneWorkspace() |
40 | if table.getn(instances) ~ = 0 then |
41 | ClearTable(instances, false ) |
43 | for number, instance in pairs (workspace:GetChildren()) do |
44 | for number 2 , tableobj in pairs (ignore) do |
45 | if instance ~ = tableobj then |
46 | local startclone = instance:Clone() |
49 | local clone = startclone:Clone() |
51 | table.insert(instances, clone) |
57 | function RestoreLastBackup() |
58 | for number, instance in pairs (workspace:GetChildren()) do |
59 | for number 2 , tableobj in pairs (ignore) do |
60 | if instance ~ = tableobj then |
64 | for number, instance in pairs (instances) do |
65 | instance.Parent = workspace |
71 | workspace.GameScripts.Events.MakeBackup.OnServerEvent:Connect(CloneWorkspace) |
72 | workspace.GameScripts.Events.RestoreBackup.OnServerEvent:Connect(RestoreLastBackup) |
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