Short answer: yes, but it depends on the code
Long answer: We would need very specific information to see what's causing the crash. For starters, what's the game? What's the value being frozen? What are you freezing the value at? How does the value interact with other parts of the game? There's a reason some codes that seem like they should be simple wind up being very long. You have to find workarounds or displace the code to get the desired result. More often than not, the desired result is much more complicated than "find single value and freeze at desired integer". Just take a look at some of the codes ymyn writes. Most of the ones I've used are him writing to empty memory and then inserting that code into a different part of the memory.
Hopefully this gives you a better idea of why you're running into this issue. I don't write code myself, but I understand how a lot of it works, so I may be able to point you in the right direction.
Yeah, I figured out the problem. It's my fault. I change the wrong part of the code that's why it always crashed.