So, I’m making a gun system, first person shooting, I’m on a part right now where there was an error prior. Anyway, there’s two separate scripts. My Module Script which has the settings, and the local script which has the framework and what not.
An error that I’m getting is “attempt to index nil with ‘fireRate’”. As far as I am aware, attempt to index nil essentially means it can’t be found. This was working perfectly fine earlier though without error, and I haven’t changed the variable for the module.
I’ve checked inside the module script and everything is spelled correctly. If anyone has solutions, please respond.
while wait() do
if isShooting then
print("FIRING")
mouse.Button1Up:Connect(function()
isShooting = false
end)
wait(framework.module.fireRate)
end
end
“Attempt to index nil” is an error that occurs when you’re trying to point to the property of something that doesn’t exist. So, you’re trying to find the ‘fireRate’ property of nil, which means your script doesn’t know what framework.module is.
Is framework your variable for the ModuleScript after being required? If so, you should follow @LordOfSapphire’s advice and change framework.module to framework.Settings.