Before I look seriously into the code, try putting a single wait(1);
at the VERY start of your player action. Then let me know how it goes.
If this fixes it, the problem was that the c_setminmax was being run
BEFORE the end of the first frame since the entities creation.
Check the manual under c_setminmax as to why this is a problem.