#Error with Module Script

1 messages · Page 1 of 1 (latest)

feral citrus
#

local rig = workspace:WaitForChild("HumanoidCameraRig")
if not rig then
warn("HumanoidCameraRig not found!")
return
end

local camPart = rig:WaitForChild("CamPart")
if not camPart then
    warn("CamPart not found in HumanoidCameraRig!")
    return
end

I have script part like this Everything is okay but still gives error anyone know why? (It's Module script in replicatedstorage btw)

feral citrus
mossy vine
feral citrus
#

I mean warn

#

It just cant find the campart

#

somehow

mossy vine
feral citrus
#

ye welded

#

to main part

#

primary

#

also anchored

mossy vine
#

This doesn't make much sense, as if it didn't exist, WaitForChild would give an infinite wait warning. It should never return nil

feral citrus
#

give me sec let me send you the ss

#

of everything

mossy vine
#

Uh how much is that

feral citrus
#

2 screenshots

#

for warn and welds

mossy vine
#

Okay

feral citrus
#

btw should I remove the weld or no?

mossy vine
feral citrus
#

CamPart Is not anchored but model's primarypart I mean rootpart Is anchored

#

also rootpart welded to campart

mossy vine
feral citrus
mossy vine
# feral citrus

Okay, so this is not your warning. It's the warning I mentioned, the infinite yield, implying it's just not there, rather than it being nil.

Try playing the game and see if CamPart is there. Make sure there is no other model in the workspace named "HumanoidCameraRig"

feral citrus
#

let me try

#

Everything seems okay tho...

mossy vine
feral citrus
#

ye let me take video

#

uploading

#

I tried almost everything I even tried AI

mossy vine
#

Are you sure that warning is stopping the script from running? Does your module do more than just making sure those parts exist?

feral citrus
mossy vine
feral citrus
#

everything works fine besides this

#

wait I guess It started to working

#

now

mossy vine
#

neat

feral citrus
mossy vine