I'm also building an FPS and mine is something like this for kickup... (why it works below -- but don't feel that you need to read that)
(in the firing sub)
[blah blah] create bullet, position it [/blah blah]
rem point weapon up
xrotate object CurrentWeapon,wrapvalue(camera angle x()+(360-(yrecoil/10)))
in weaponYangle,yrecoil/10
`yrecoil is set earlier in the loop to be a random number between 0 and 30
[blah blah] position 3dsound, play 3dsound [/blah blah]
(end firing sub)
(in Gun Recoil sub)
if WeaponYangle > 3
xrotate object CurrentWeapon,wrapvalue(camera angle x()+ 3)
dec weaponYangle,3
endif
if WeaponYangle <= 3
xrotate object CurrentWeapon,wrapvalue(camera angle x()+ weaponYangle)
weaponYangle = 0
endif
(end recoil)
[school teacher-like droning]
xrotate rotates down which is why to go up 3, you need the wrap value of 360 - yrecoil (it can be a fixed amount, but mine is random)
then add that to the current x angle of an object -- but for a easier game, I'll use the camera instead...
so camera is pointing up 3 (X angle of 357)
yrecoil was 20, over 10 made it 2, so the weapon's pointed up 2 degrees.
would work out as: 357 + 358...
that comes to 715 which isn't allowed, so wrap value just takes 360 away from a number infinitely until it's between 0 and 360 which is valid.
[/droning]
...maybe one day I'll finish a project