scoreboard players set #distance raycast_time 300

execute store result score #random temp run random value 1..4

$execute if score #random temp matches 1 rotated ~0.$(x) ~0.$(y) run function pctf:logic/items/railgun/loop_raycast
$execute if score #random temp matches 2 rotated ~-0.$(x) ~0.$(y) run function pctf:logic/items/railgun/loop_raycast
$execute if score #random temp matches 3 rotated ~-0.$(x) ~-0.$(y) run function pctf:logic/items/railgun/loop_raycast
$execute if score #random temp matches 4 rotated ~0.$(x) ~-0.$(y) run function pctf:logic/items/railgun/loop_raycast