Everytime i use this script, my game crashes? it is called from an ti_on_weapon_attack trigger and the weapon only shoots once in the minute.
thank you for your help
freak_0z
Code:
("random_artillery",
[
(store_mission_timer_a, ":time"),
(try_begin),
(ge, ":time", 30),
(call_script, "script_team_get_average_position_of_enemies", 1),
(try_for_agents,":agents"),
(agent_is_alive, ":agents"),
#(copy_position,pos1,pos0),
(position_get_x,":boomx",pos0),
(position_get_y,":boomy",pos0),
(store_random_in_range, ":rnd", -200, 200),
(val_add,":boomx",":rnd"),
(val_add,":boomy",":rnd"),
(position_set_x,pos0,":boomx"),
(position_set_y,pos0,":boomy"),
(particle_system_burst, "psys_explo_smoke",pos0,300),
(agent_get_position,pos2,":agents"),
(get_distance_between_positions,":boom_distance",pos0,pos2),
(lt,":boom_distance",50),
(particle_system_burst,"psys_game_blood",pos2,100),
(agent_play_sound, ":agents", "snd_man_die"),
(agent_set_hit_points,":agents",0,0),
(agent_deliver_damage_to_agent,":agents",":agents"),
(try_end),
(try_end),
]),
thank you for your help
freak_0z