--by pavetr.top/ds local inprogress = false local sw, sh = ScrW(), ScrH() local w, h = sw / 6, sh / 12 local x, y = sw / 2 - w / 2, sh / 2 + h local dx, dy, dw, dh, pp, pos, tm local am = Material("gmodla/hud/hudarrow.png", "smooth") local cls = { Color(228, 112, 45), Color(175, 49, 49), Color(63, 72, 80, 255), Color(0, 0, 0, 148), } --Obtained values local sp = 2 local ps = 2 local hold local tmr = 0.5 local stm = 0 local trms = 0 -- Переменные для автоматического клика local autoClickTime = 0 local shouldAutoClick = false hook.Add("DrawOverlay", "SkillCheck", function() if not inprogress then return end tm = math.Clamp(((stm + trms) - CurTime()) / tmr, 0, 1) surface.SetDrawColor(cls[3]) surface.DrawOutlinedRect(x - 2, y - 2, w + 4, h + 4, 2) surface.DrawOutlinedRect(x - 2, y - h / 3 - 2, w + 4, h / 3, 2) draw.RoundedBox(0, x, y - h / 3, w, h / 3 - 4, cls[4]) draw.RoundedBox(0, x, y - h / 3, w * tm, h / 3 - 4, cls[1]) for i = 0, 19 do dx, dy, dw, dh = x + i * (w / 20), y, w / 20, h local cl = cls[2] if (i >= sp - 1 and i < sp) and LocalPlayer():getDarkRPVar("energy") > 250 then cl = cls[3] end draw.RoundedBox(0, dx, dy, dw, dh, (i >= sp and i < sp + ps) and cls[1] or cl) surface.SetDrawColor(cls[4]) surface.DrawOutlinedRect(dx, dy, dw, dh, 1) end pp = dw * 3 -- Рассчитываем центр успешной зоны local targetPos = (sp + ps / 2) / 20 if not hold then -- Мгновенное перемещение стрелки в центр зоны pos = targetPos -- Если еще не было автоклика if not shouldAutoClick then shouldAutoClick = true -- autoClickTime = CurTime() + 0.05 -- Очень короткая задержка перед кликом autoClickTime = CurTime() + 0.001 end end -- Автоматический клик при достижении центра if shouldAutoClick and CurTime() >= autoClickTime then shouldAutoClick = false hold = true net.Start("GmodLA.SCheckr") net.WriteFloat(pos) net.WriteFloat(CurTime()) net.SendToServer() end MSD.DrawTexturedRect(x + (w * pos) - pp / 2, y + h - pp / 4, pp, pp, am, color_white) if tm <= 0 then inprogress = nil end end) -- Остальной код остается без изменений local lcc = 0 hook.Add("PlayerBindPress", "SkillCheck", function(ply, bind) if not inprogress then return end if (string.find(bind, "attack")) then if lcc < CurTime() then lcc = CurTime() + 0.2 hold = true net.Start("GmodLA.SCheckr") net.WriteFloat(pos) net.WriteFloat(CurTime()) net.SendToServer() end return true end end) net.Receive("GmodLA.SCheckr", function() local typ = net.ReadUInt(2) if typ == 1 then inprogress = nil return end if typ == 0 then inprogress = true sp = net.ReadUInt(5) ps = net.ReadUInt(5) tmr = net.ReadUInt(12) stm = net.ReadFloat() trms = tmr / 3 hold = nil shouldAutoClick = false pos = 0 -- Сброс позиции при новой мини-игре end if typ == 2 then trms = trms + net.ReadUInt(5) hold = nil sp = net.ReadUInt(5) shouldAutoClick = false -- Сброс флага автоклика при изменении зоны end end)