why is my script completely ignoring these conditions?
I have a function where you click a sight attachment, and it attaches to your gun. However, the statements at lines 18 and 28 do not work, but do not create any errors. It seems like they are completely ignored. Is there a way to fix this or is there some sort of limit to how many conditions can be used in a function?
01 | attachments.Mini.Click:FindFirstChild( "ClickDetector" ).MouseClick:connect( function () |
02 | local attpoint = self.current:FindFirstChild( "optic" ) |
03 | local handle = self.current:FindFirstChild( "Handle" ) |
04 | local origin = self.current:FindFirstChild( "HandleOrigin" ) |
05 | if interaction = = true and attpoint.Mini.Value = = true then |
07 | if currentoptic = = nil then |
09 | elseif currentoptic ~ = nil and currentoptic ~ = Mini then |
10 | currentoptic:Destroy() |
12 | handle.Position = origin.Position |
14 | attpoint:FindFirstChild( "Motor6D" ):Destroy() |
15 | self.config.aimFOV = 70 |
16 | self.config.zoomScale = 1 |
18 | elseif currentoptic = = Mini then |
19 | currentoptic:Destroy() |
21 | handle.Position = origin.Position |
23 | attpoint:FindFirstChild( "Motor6D" ):Destroy() |
24 | self.config.aimFOV = 70 |
25 | self.config.zoomScale = 1 |
28 | if self.current:FindFirstChild( "Iron Sights" ) then |
29 | local children = self.current:FindFirstChild( "Iron Sights" ):GetChildren() |
30 | for i = 1 ,#children do |
31 | children [ i ] .Transparency = 0 |