I’ve got these two NumberValues that I’m using to determine the “max spread” and “inaccuracy step amount” of a gun. I declare them in the main local script with local MaxSpread = script.Parent.Values.MaxSpread.Value
and local AimInaccuracyStepAmount = script.Parent.Values.AimInaccuracyStepAmount.Value
. I’ve got another local script that manages aiming the gun and also changes the max spread and inaccuracy step amount values. The problem is that the main local script doesn’t accept these new values when it needs to use them. I’m not sure how to make the new values count.
Code that references these values, if that somehow helps:
if Spread and not DecreasedAimLastShot then
Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
UpdateCrosshair(Spread)
end
while true do
wait(0.3)
if Spread and not IsShooting then
local currTime = time()
if currTime - LastSpreadUpdate > FireRate * 2 then
LastSpreadUpdate = currTime
Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
UpdateCrosshair(Spread, MyMouse)
end
end
end