Errors show up in-game but not in studio?

hello so i basically got no idea what category this should be so i used scripting support because its the most popular ig, so my problem is that whenever i try my game in roblox studio everything works fine but when i try it in-game it just errors everything, is there a way to fix that???

Could you please show some code so we can work out what is wrong.
Thank you.

By the way, check if there’s any RunService:IsStudio(), RunService:IsClient() etc in the script - It might be the issue

What is the error you received and code including

the main errors are from my guns. i got like 5 guns and each of them have a serverscriptservice with 100+ lines and a local script with 100+ lines.

and i got a variable called “ammo” and everytime i shoot i get an error that the ammo isn’t a valid member of the gun (i already tried FindFirstChild)

Can you show a code snippet of where you get the error in your code?

remoteEvent:FireServer(gun.Handle.Position, gun.Handle.Orientation, mouse.Hit.p)
				game.Lighting.GunCorrection.Enabled = true
				Camera.CFrame = Camera.CFrame * CFrame.Angles(0.09,math.rad(1),0)
				player.PlayerGui.WhiteFlashForGun.Enabled = true
				*gun.Ammo.Value -= 1*
				wait(0.01)
				player.PlayerGui.WhiteFlashForGun.Enabled = false
				game.Lighting.GunCorrection.Enabled = false

Can you show the gun - ammovalue in the explorer?

Are you sure the ammo value exists on the client?

I faced a similar issue in terms of code working in Roblox Studio and not Roblox Player. Perhaps this could help?