1 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 AM FROM BRAZIL !!!]
006 | workspace.GameScripts, |
019 | function PlayerJoined(player) |
020 | player.CharacterAdded:Connect( function () |
021 | if table.find(ignore, player.Character) = = nil then |
022 | table.insert(ignore, player.Character) |
024 | warn( "O character do jogador: " ..player.Name.. " Foi adcionado mas já está na tabela" ) |
029 | function ClearTable(tbl, IsInstance) |
030 | if IsInstance = = true then |
031 | for _, v in pairs (tbl:GetChildren()) do |
035 | for number in pairs (tbl) do |
036 | table.remove(instances, number) |
041 | function CloneWorkspace() |
042 | if table.getn(instances) ~ = 0 then |
043 | ClearTable(instances, false ) |
062 | local _workspace = workspace:GetChildren() |
063 | for i = 1 , #_workspace do |
064 | for j = 1 , #ignore do |
065 | if _workspace [ i ] ~ = ignore [ j ] then |
066 | local startclone = workspace [ i ] :Clone() |
069 | local clone = startclone:Clone() |
077 | function RestoreLastBackup() |
095 | local _workspace = workspace:GetChildren() |
096 | for i = 1 , #_workspace do |
097 | for j = 1 , #ignore do |
098 | if _workspace [ i ] ~ = ignore [ j ] then |
099 | workspace [ i ] :Destroy() |
104 | for number, instance in pairs (instances) do |
105 | instance.Parent = workspace |
110 | workspace.GameScripts.Events.MakeBackup.OnServerEvent:Connect(CloneWorkspace) |
111 | workspace.GameScripts.Events.RestoreBackup.OnServerEvent:Connect(RestoreLastBackup) |
112 | game:GetService( "Players" ).PlayerAdded:Connect(PlayerJoined) |
Script error:
1 is not a valid member of Workspace
Stack Begin
Script 'Workspace.GameScripts.ServerBackupV2', Line 66 - function CloneWorkspace
Stack End