UI.AddDropdown("Custom ClanTag", ["Disabled", "medusa"]);
UI.AddSliderInt("Custom ClanTag Speed", 1, 50);
var lasttime = 0;
function onRender()
{
    var tag = UI.GetValue("Script Items", "Custom ClanTag");
    var speed = UI.GetValue("Script Items", "Custom ClanTag Speed");
    var time = parseInt((Globals.Curtime() * speed))
    if (time != lasttime)
    {
        if (tag == 0)
        {
            Local.SetClanTag("");
        }
        if (tag == 1) {
            switch ((time) % 20) {
                case 1: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 2: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 3: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 4: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 5: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 6: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 7: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 8: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 9: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 10: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 11: { Local.SetClanTag("MḔÐЦSÄ'<"); break; }
                case 12: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 13: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 14: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 15: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 16: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 17: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 18: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 19: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
                case 20: { Local.SetClanTag("MḔÐЦSÄ'"); break; }
            }
        }
    }
    lasttime = time;
}
Cheat.RegisterCallback("Draw", "onRender");


UI.AddCheckbox('medusa logs');

function medusatechlogs() {
    attackerEntity = Entity.GetEntityFromUserID(Event.GetInt('attacker'));
    localEntity = Entity.GetLocalPlayer();
    if (attackerEntity == localEntity) {
        victimName = Entity.GetName(Entity.GetEntityFromUserID(Event.GetInt('userid')));
        hitboxName = hitgroupToHitbox(Event.GetInt('hitgroup'));
        damageDone = Event.GetInt('dmg_health');
        healthRemaining = Event.GetInt('health');
        hurtLogs.push([victimName, hitboxName, damageDone, healthRemaining, 0, 255, (Math.random() * (0.2 - 1.200) + 1.200).toFixed(4), Globals.Curtime()])
    }
}
hurtLogs = [];
typeSpeed = 0.05;
fadeOutSpeed = 8;
showDelayTime = typeSpeed + Globals.Curtime();

function medusalogs2() {
    for (var _0x1873x4 = 0; _0x1873x4 < hurtLogs.length; _0x1873x4++) {
        hurtLogs[_0x1873x4][4]++;
        toSay = victimName + ' ' + hitboxName + ' ' + damageDone + ' ' + '(' + healthRemaining + ')';
        if (Globals.Curtime() - hurtLogs[_0x1873x4][7] < 2) {
            continue
        };
        hurtLogs[_0x1873x4][5] -= Globals.Frametime() * 500;
        if (hurtLogs[_0x1873x4][5] < 0) {
            hurtLogs.shift(_0x1873x4, 1)
        }
    }
}

function medusalogs3() {
    if (UI.GetValue('Misc', 'JAVASCRIPT', 'Script items', 'medusa logs')) {
        localplayer_index = Entity.GetLocalPlayer();
        localplayer_alive = Entity.IsAlive(localplayer_index);
        if (localplayer_alive == true) {
            screen = Render.GetScreenSize();
            textX = (screen[0] / 2);
            textY = (screen[1] / 2) + 100;
            textYIncrement = 12;
            textCol = [255, 255, 255];
            for (var _0x1873x4 = 0; _0x1873x4 < hurtLogs.length; _0x1873x4++) {
                currentLog = hurtLogs[_0x1873x4];
                victimName = currentLog[0];
                hitboxName = currentLog[1];
                damageDone = currentLog[2];
                healthRemaining = currentLog[3];
                currentTextPos = textY + (textYIncrement * _0x1873x4);
                toSay = victimName + ' ' + hitboxName + ' ' + '-' + damageDone + ' ' + '(' + healthRemaining + ')';
                textCol = [255, 255, 255];
                textColdead = [200, 0, 0];
                if (healthRemaining > 0) {
                    Render.String(textX + 1, currentTextPos + 1, 1, toSay, [0, 0, 0, hurtLogs[_0x1873x4][5]], 8);
                    Render.String(textX, currentTextPos, 1, toSay, [textCol[0], textCol[1], textCol[2], hurtLogs[_0x1873x4][5]], 8)
                };
                if (healthRemaining <= 0) {
                    Render.String(textX + 1, currentTextPos + 1, 1, toSay, [0, 0, 0, hurtLogs[_0x1873x4][5]], 8);
                    Render.String(textX, currentTextPos, 1, toSay, [textColdead[0], textColdead[1], textColdead[2], hurtLogs[_0x1873x4][5]], 8)
                }
            }
        }
    }
}

function hitgroupToHitbox(_0x1873x47) {
    hitbox = 'generic';
    switch (_0x1873x47) {
    case 0:
        hitbox = 'head';
        break;
    case 1:
        hitbox = 'neck';
        break;
    case 2:
        hitbox = 'pelvis';
        break;
    case 3:
        hitbox = 'body';
        break;
    case 4:
        hitbox = 'chest';
        break;
    case 5:
        hitbox = 'chest';
        break;
    case 6:
        hitbox = 'upper chest';
        break;
    case 7:
        hitbox = 'left thigh';
        break;
    case 8:
        hitbox = 'right thigh';
        break;
    case 9:
        hitbox = 'left calf';
        break;
    case 10:
        hitbox = 'right calf';
        break;
    case 11:
        hitbox = 'left foot';
        break;
    case 12:
        hitbox = 'right foot';
        break;
    case 13:
        hitbox = 'left hand';
        break;
    case 14:
        hitbox = 'right hand';
        break;
    case 15:
        hitbox = 'left arm';
        break;
    case 16:
        hitbox = 'left forearm';
        break;
    case 17:
        hitbox = 'right arm';
        break;
    case 18:
        hitbox = 'right forearm'
    };
    return hitbox
}

Cheat.RegisterCallback('Draw', 'medusalogs2');
Cheat.RegisterCallback('Draw', 'medusalogs3');
Cheat.RegisterCallback('player_hurt', 'medusalogs');
