Value updating on server, but not for the script?

So whats happening is, the script for this proximity prompt is to refill stored and loaded ammo, and does so on the serve, BUT, for some reason the script for the gun, also a server script, doesnt know that the ammo was refilled??? I have no idea what is happening and it is BEYOND me

Output:
image

also wierd, that the ammo instance also doesnt change, yet the script thinks it did??? im so confused

Do you think you could share any of the script? A little confused on what it could be

From my understanding, there are two server scripts. One reloads, one uses ammo. How does the reload script update the firiny script with the amount of ammo? Do you use an event or is there an instance (such as a value or an attribute) that the reloader changes?

1 Like

so the reload and shoot function are in one script, and the refill is in another, and yes they’re number values
image

Ah. Alright. So, what does the firing script do exactly? I have a feeling you are getting the ammo once and on fire only subtracting from that value (either the actual number value or just the variable in the script)

In other words, make sure to update the variable inside of the firing script either whenever the value changes or within the function on fire.

You might need to restructure it a little, i believe you are subtracting from the local variable.

Local Firing=Function()
AmmoVariable = Pistol.Values.Ammo.Value
– Your other Code
AmmoVariable = AmmoVariable-1
end

Sorry if thats hard to understand, im not sure if this would fix it either im just guessing thats what is happening. If you

1 Like