Lots of things can cause this, unfortunately. The most common one we’ve found is A) you have nil where your not expecting one, or B) you have a while loop with no “wait”.
Solution to A: Check for nil’s
if variable ~= nil then -- do something end
Solution for B:
Every while has to have a wait. The wat can be zero but it has to be there. Yes, I know that makes no sense, but that’s the reality of cfx and redm. Put the wait in, you’ll thank us later.
while true do Citizen.Wait(0) -- triggers some event or variable that prevents client crash end