Functions not changing variables

Hi, so I was working on a gun system and now I have realized that my functions are not changing the variables.
This is what I mean

local function AimIn()
	if Reloading then return end
	if Inspecting then return end
	AimingIn = true

When it changes the AimingIn to true, and I try to print AimingIn it still says false, indicating that this function has not changed the value, this is in a local script and yes I am running the function.

This is what my variables look like

Aiming = false
AimingIn = false
AimingOut = false

It’s because variables “Reloading” and “Inspecting” are not meeting the conditions.

I’ve checked and they are meeting the conditions because when I run the function it does what it’s supposed to do, but it is not changing the variables.

Is it in a localscript? If it’s in a localscript, it will not work as intended.

Share the full script, I’m assuming you have a scoping issue (trying to reference a variable out of scope).

He’s referring to variables not value instances I believe.

You can only have 255 local declarations per script instance.

What do you mean by declarations? Can you elaborate more?