So, the issue I'm having is that a single line of my code suddenly stopped working as it should.
I'm making a horror game and this script is for one of the jumpscares it'll have. It should set the monster parts transparency to zero and play an animation when a brick is touched, followed by the glass breaking in a loud sound. The problem is that the monster parts transparency's part of the script suddenly stopped working. The whole rest of the script works as intended, but it's like it is skipping that specific line. Now, it only sets the base part of the monster's transparency to zero, even though the code tells it to get all children that are a ClassName Part. I already tried checking lots of times for grammar errors, variable names errors, valid or not members of x model errors, etc. I've tried rewriting the script, restarting studio, changing game settings, none of that works. It just glitched out of nothing and keeps glitched forever. Also it's a regular script, because I want it to show for all players. The output doesn't show any errors.
The specific line I'm talking about is "item.Transparency = 0" (line 10) btw. Any help is highly appreciated!
local anim = script.Parent.Parent.Parent.HE.AnimationController:LoadAnimation(script.Parent.Parent.Parent.HE.Animation)
local checkAnim = false
local played3 = false
local somSus = game.Workspace.SomLiv["Distressed Moaning (6)"]
script.Parent.Touched:Connect(function(hit)
local childs = script.Parent.Parent.Parent.HE
for _, item in pairs(childs:GetChildren()) do
if item:IsA('Part') then
item.Transparency = 0
end
