How do you Fix Workspace.nathanjohns123.ZAWURLDO:60: attempt to index nil with 'Parent'?
I Want To Make A Time Freeze Mechanic But I Keep Getting This Error Saying
Workspace.nathanjohns123.ZAWURUDO:60: attempt to index nil with 'Parent'
Can You Either Tell Me how to print A Directory eg: Instead Of Printing "Part" It Prints "game.Workspace.Part"
or Tell Me how To Fix It?
(if you want to test it put the script in the startercharacterscripts)
Here's My Time Freeze Code The Error Is happening At the function loop2()
003 | children = game.Workspace:GetChildren() |
007 | WaveSpeed = game.Workspace.Terrain.WaterWaveSpeed |
008 | RespawnTime = game.Players.RespawnTime |
012 | local Children = Child [ i ] :GetChildren() |
013 | local Parent = Child [ i ] |
016 | if Parent = = game.Workspace then |
020 | Parent = Parent.Parent |
021 | table.insert(Issues,Parent) |
025 | if Issues [ i ] = = script.Parent then |
030 | if Child [ i ] .ClassName = = "Script" or Child [ i ] .ClassName = = "LocalScript" then |
031 | if Ignore = = false then |
032 | local IN = Instance.new( "BoolValue" ) |
034 | IN.Name = "DisabledV" |
035 | IN.Value = Child [ i ] .Disabled |
036 | Child [ i ] .Disabled = true |
039 | if Child [ i ] .ClassName = = "Part" or Child [ i ] .ClassName = = "MeshPart" then |
040 | if Ignore = = false then |
041 | local IN = Instance.new( "BoolValue" ) |
043 | IN.Name = "AnchoredV" |
044 | IN.Value = Child [ i ] .Anchored |
045 | Child [ i ] .Anchored = true |
053 | local Children = Child [ i ] :GetChildren() |
054 | local Parenta = Child [ i ] |
057 | if Parenta = = game.Workspace then |
060 | Parenta = Parenta.Parent |
061 | table.insert(Issues,Parenta) |
065 | if Issues [ i ] = = script.Parent then |
071 | if Child [ i ] .ClassName = = "Part" or Child [ i ] .ClassName = = "MeshPart" then |
072 | if Ignore = = false then |
073 | Child [ i ] .Anchored = Child [ i ] .AnchoredV.Value |
074 | Child [ i ] .AnchoredV:Destroy() |
077 | if Child [ i ] .ClassName = = "Script" or Child [ i ] .ClassName = = "LocalScript" then |
078 | if Child [ i ] .Name ~ = "FOV Change" then |
079 | if Ignore = = false then |
080 | Child [ i ] .Disabled = Child [ i ] .DisabledV.Value |
081 | Child [ i ] .DisabledV:Destroy() |
088 | Players = game.Players:GetChildren() |
092 | if Time = = true and TimeC = = Time then |
095 | game.Workspace.Terrain.WaterWaveSpeed = 0 |
096 | game.Players.RespawnTime = 99999999999 |
099 | if Time = = false and TimeC = = Time then |
101 | game.Players.RespawnTime = RespawnTime |
102 | game.Workspace.Terrain.WaterWaveSpeed = WaveSpeed |
106 | game.Lighting.ColorCorrection.Contrast - = 0.05 |
107 | if game.Lighting.ColorCorrection.Contrast < = - 2 then |
111 | game.Lighting.ColorCorrection.Contrast + = 0.2 |
112 | if game.Lighting.ColorCorrection.Contrast > 0 then |
113 | game.Lighting.ColorCorrection.Contrast = 0 |
114 | script.Trans.Value = false |
122 | if Break = = true then |
131 | script.Trans.Changed:Connect( function () |
132 | if script.Trans.Value = = true then |
133 | game.Workspace.TF.Playing = true |
(Yes It Is Long)
Anyways Can You Help Me With This?