Difference between revisions of "Useful Scripts"
m
→Ground area mark that follows the crosshair: Removed extra "endif" statement on line 33 of script; standardised indentation so it's consistent with the other scripts on this page
imported>Skingrad24 |
imported>Cipscis m (→Ground area mark that follows the crosshair: Removed extra "endif" statement on line 33 of script; standardised indentation so it's consistent with the other scripts on this page) |
||
Line 41: | Line 41: | ||
begin gamemode | begin gamemode | ||
set xang to player.getangle x | set xang to player.getangle x | ||
set zang to player.getangle z * -1 + 90 | set zang to player.getangle z * -1 + 90 | ||
;;;;;;;;;;The formula below was found by Skingrad24 and you must mention him in your credits, thisline must remain intact | ;;;;;;;;;;The formula below was found by Skingrad24 and you must mention him in your credits, thisline must remain intact | ||
if xang <= 5 | if xang <= 5 | ||
set lont to 1300; you can change this value if you need to | |||
else | else | ||
set playerheight to 252 | if player.issneaking == 0 | ||
set playerheight to 322 | |||
else | |||
set playerheight to 252 | |||
endif | |||
set lont to (playerheight*cos xang/sin xang * 0.34118010537042257764) | |||
endif | endif | ||
set xang to player.getangle x * -1 | set xang to player.getangle x * -1 | ||
set x to lont * cos xang * cos zang | set x to lont * cos xang * cos zang | ||
set y to lont * cos xang * sin zang | set y to lont * cos xang * sin zang | ||
Activator.moveto player x y 0 | Activator.moveto player x y 0 | ||
end | end |