"Attempt to index nil with Value"

So basically in a local script, I put a bool value called “airattack” for something that requires the humanoid to be in freefall.
In the weapon, there’s a “form” value that changes how fast the weapon attacks when the value is true. When the form value is false the airattack value works perfectly fine but whenever I make the form value true it stops working and gives me this error:

Here are the lines:
(local airattack = false is line 20)
image

I can’t figure out why it’s giving me this error, so help is appreciated.

1 Like

Is all content here your full script? Because I didn’t see any line that’s looking for something’s value.

Its not my full script but its the only part that uses that value, also I don’t fully understand whats going on either because it is giving me an error for line 20 whenever I’m using the second picture’s script (if airattack == false then & elseif airattack == true then)

Have you set a var like local airattack = something.Value before the line 20 here? As what I said, the line 20 you showed me here is not even looking for a value.
You will get a value object’s value by using something like something.Value , but in line 20 it’s even not looking for a .Value

No I didn’t set anything like that it’s just saying the value is nil for some reason.

Kinda confused because the line 20 you showed me, but are you sure the bool value object’s parent is correct when you are looking for the bool value?

It’s actually saying you are missing the object when looking for its value, I believe.

The value isn’t an object I worded it wrong, my bad. It’s the true/false value only inside of the script. airattack = false is just a value solely for inside of the script. Sorry for the confusion

Are these 2 scripts 1 or multiple I’m confused about this error a bit.

These are inside of one script

Found the solution, apparently something in another script was acting up at the same time as using this I’m just dumb :skull: Sorry for the issues

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.