Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ui_get = ui.get
- local ui_set = ui.set
- local ui_set_visible = ui.set_visible
- local globals_tickcount = globals.tickcount
- local globals_tickinterval = globals.tickinterval
- local globals_realtime = globals.realtime
- local client_world_to_screen = client.world_to_screen
- local client_draw_text = client.draw_text
- local string_format = string.format
- local table_insert = table.insert
- local localplayer = entity.get_local_player;
- local last_bullet_impact = {};
- local damage_indicator_displays = {}
- local enabled_reference = ui.new_checkbox( "VISUALS", "Player ESP", "Damage Indicator" );
- local duration_reference = ui.new_slider( "VISUALS", "Player ESP", "Duration", 1, 10, 3, true, "s" );
- local mode_reference = ui.new_combobox( "VISUALS", "Player ESP", "Mode", { "Static", "Moving" } );
- local minimum_damage_referance = ui.reference( "RAGE", "Aimbot", "Minimum damage" );
- local function min( a, b )
- if ( a < b ) then return a;
- else return b; end
- end
- local function on_bullet_impact(e)
- if not ui_get( enabled_reference ) then return end
- if not ( client.userid_to_entindex( e.userid ) == localplayer() ) then return end
- last_bullet_impact[1] = e.x;
- last_bullet_impact[2] = e.y;
- last_bullet_impact[3] = e.z;
- end
- local function on_player_hurt(e)
- if not ui_get(enabled_reference) then return end
- --local userid, attacker, health, armor, weapon, damage, dmg_armor, hitgroup = e.userid, e.attacker, e.health, e.armor, e.weapon, e.dmg_damage, e.dmg_armor, e.hitgroup
- local userid, attacker, damage, health = e.userid, e.attacker, e.dmg_health, e.health
- if ( userid == nil ) or ( attacker == nil ) then return end
- local player = client.userid_to_entindex( userid );
- if not ( player == localplayer() ) then return end
- local x, y, z = last_bullet_impact[1], last_bullet_impact[2], last_bullet_impact[3];
- table_insert( damage_indicator_displays, { damage, globals_realtime( ), x, y, z, e } );
- --table_insert(damage_indicator_displays, {damage, globals_realtime(), x, y, z + voZ, e})
- end
- local function checkbox_callback()
- local enabled = ui_get( enabled_reference );
- ui_set_visible( duration_reference, enabled );
- ui_set_visible( mode_reference, enabled );
- end
- checkbox_callback();
- ui.set_callback( enabled_reference, checkbox_callback );
- local function on_paint( ctx )
- if not ui_get( enabled_reference ) then return end
- local maximum_time = ui_get( duration_reference );
- local minimum_damage = ui_get( minimum_damage_referance );
- local temporary_indicator_array = {};
- for i=1, #damage_indicator_displays do
- local indicator = damage_indicator_displays[ i ];
- local damage, elapsed_time, x, y, z, entity = indicator[ 1 ], globals_realtime( ) - indicator[ 2 ], indicator[ 3 ], indicator[ 4 ], indicator[ 5 ], indicator[ 6 ];
- local damage_percent, elapsed_time_percent = min( ( damage / minimum_damage ), 1 ), ( elapsed_time / maximum_time );
- if ( elapsed_time < maximum_time ) then
- local r, g, b, a = 255 - ( damage_percent * 255 ), 132 + ( damage_percent * 123 ), 133, elapsed_time_percent * 255;
- local z_addition = 0;
- if ( ui_get( mode_reference ) == "Moving" ) then z_addition = ( elapsed_time_percent * 10 ); end
- local screen_x, screen_y = client_world_to_screen( ctx, x, y, z + z_addition );
- client_draw_text( ctx, screen_x, screen_y, r, g, b, a, "c", 0, damage )
- table_insert( temporary_indicator_array, indicator );
- end
- end
- damage_indicator_displays = temporary_indicator_array;
- end
- client.set_event_callback("bullet_impact", on_bullet_impact);
- client.set_event_callback("player_hurt", on_player_hurt);
- client.set_event_callback("paint", on_paint);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement