This error is driving me insane, im developing a county game and im currently having this super weird error that ONLY happens when doing a team test or playing the published version, in studio there is no error, anyone got any idea what i should look into as for idk how roblox handles things so i can try and fix this. i have no idea where to start since this is such a weird situation idk what to look at first to try and fix it.
This error is annoying the hell out of me, been developing for hours and everything is working fine in studio then when i went to test it with someone else on my team this error popped up, it happens for all our weapons and im not sure why it wouldnt happen in studio and only in prod
Heres the function which is producing the error, i dont think anything elsewhere would be contributing to it nor do i understand why this function would be causing a issue only in production and not in studio.
if the error is “attempt to index nil with LoadedAmmo”, it probably hasn’t loaded in yet. try using WaitForChild instead.
The property its trying to access is part of a table which nolonger exists once the tool is unequiped, tho still its weird for it to only happen in prod which is my main thing, it functions fine in studio so im looking for anything that would be different between the two environments i should look into for a solution
Alright well i found what i believe to potentially be the issue, this function here is sorta messing up, when in studio it runs properly, runs the top part to equip and bottom part to unequip, however when the game is published it only ever runs the top part and never unequips the weapon, now i need to figure out why.
Fixed it, just reversed the if statement order and now it functions properly. SMH