I see this working:
Code: Select all
alias nodamage "buddha; nodamageh"
alias nodamageh "give megasphere; wait; nodamageh"
alias nodamage2 "buddha2; nodamage2h"
alias nodamage2h "give megasphere; wait; nodamage2h"
I'm also only saying what's below if you don't want to use buddha.
Buddha should be used in cases such as these, not to just test the player's pain state, but also how much damage stuff does.
One problem with this is, if you have sv_cheats set to 0, be prepared for console spam.
Plus, a map restart is necessary to stop this cheat, so it's hard to undo.
Fun fact! The most health you can give yourself (via "give health") at one point seems to be 32767.
So I'm gonna go ahead and take what Gez said and some what "enhance" it (or make it worse, however you view it. I find it to do both

)
So, if you want to go down the route of an infinite console command loop, maybe use this:
Code: Select all
alias infinitehealth "give health 32767; wait; infinitehealth"
infinitehealth
I've tried it, and letting it go off for a few ticks, I can't even kill myself with the kill command.
You also need to restart the map to stop this one.