I'm a relatively new scripter (I've programmed in Lua before, but I'm new to Roblox's framework) and I've decided to program a little weapons system with caliber based bulletholes/energy.

So, my problem is that, when I fire a weapon and the bullet hits a part, it spawns in particles and a bullet hole client-side, but, server-side, it does not do either and it spews out an error that says "Attempt to index nil with BulletType". The error outputs to this line of code; local w = (calibers[Settings.BulletType] or calibers["2.7mm"]). The calibers module only handles the various calibers and does not need anything else in it.

How would I fix this issue? By the way, "w" is for the width of the bullet.

4 comments

0

'Settings' is nil.

0

Thing is that the BulletType is in the Settings module of each gun, so that connects to the Calibers module to make it work properly. I don't know how to engineer this, so I need some serious help here.

1

Give us more context, we cant really work with that

0

That gave us no insight into the state of 'Settings'. How are you declaring it?