Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local abs_frame_time = globals.AbsoluteFrameTime; local frame_rate = 0.0; local get_abs_fps = function() frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * abs_frame_time(); return math.floor((1.0 / frame_rate) + 0.5); end
- frequency = 0.1 -- range: [0, oo) | lower is slower
- intensity = 180 -- range: [0, 255] | lower is darker
- saturation = 1 -- range: [0.00, 1.00] | lower is less saturated
- function hsvToR(h, s, v)
- local r, g, b
- local i = math.floor(h * 6);
- local f = h * 6 - i;
- local p = v * (1 - s);
- local q = v * (1 - f * s);
- local t = v * (1 - (1 - f) * s);
- i = i % 6
- if i == 0 then r, g, b = v, t, p
- elseif i == 1 then r, g, b = q, v, p
- elseif i == 2 then r, g, b = p, v, t
- elseif i == 3 then r, g, b = p, q, v
- elseif i == 4 then r, g, b = t, p, v
- elseif i == 5 then r, g, b = v, p, q
- end
- return r * intensity
- end
- function hsvToG(h, s, v)
- local r, g, b
- local i = math.floor(h * 6);
- local f = h * 6 - i;
- local p = v * (1 - s);
- local q = v * (1 - f * s);
- local t = v * (1 - (1 - f) * s);
- i = i % 6
- if i == 0 then r, g, b = v, t, p
- elseif i == 1 then r, g, b = q, v, p
- elseif i == 2 then r, g, b = p, v, t
- elseif i == 3 then r, g, b = p, q, v
- elseif i == 4 then r, g, b = t, p, v
- elseif i == 5 then r, g, b = v, p, q
- end
- return g * intensity
- end
- function hsvToB(h, s, v)
- local r, g, b
- local i = math.floor(h * 6);
- local f = h * 6 - i;
- local p = v * (1 - s);
- local q = v * (1 - f * s);
- local t = v * (1 - (1 - f) * s);
- i = i % 6
- if i == 0 then r, g, b = v, t, p
- elseif i == 1 then r, g, b = q, v, p
- elseif i == 2 then r, g, b = p, v, t
- elseif i == 3 then r, g, b = p, q, v
- elseif i == 4 then r, g, b = t, p, v
- elseif i == 5 then r, g, b = v, p, q
- end
- return b * intensity
- end
- function use_Crayon()
- local ff = draw.CreateFont('Tahoma', 60)
- local classicf = draw.CreateFont('Tahoma', 12)
- local name = client.GetPlayerNameByIndex(client.GetLocalPlayerIndex())
- local x, y = draw.GetScreenSize()
- local R = hsvToR((globals.RealTime() * frequency) % 1, saturation, 1)
- local G = hsvToG((globals.RealTime() * frequency) % 1, saturation, 1)
- local B = hsvToB((globals.RealTime() * frequency) % 1, saturation, 1)
- -- box
- --draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
- --draw.FilledRect(0, 0, x, 1)
- draw.Color(35, 35, 35, 255)
- draw.FilledRect(3, 5, 180, 30)
- draw.Color(15, 15, 15, 180)
- draw.FilledRect(8, 10, 175, 25)
- draw.Color(70, 70, 70, 180)
- draw.OutlinedRect(8, 10, 176, 26)
- draw.Color(0, 0, 0, 255)
- draw.OutlinedRect(2, 4, 181, 31)
- draw.Color(70, 70, 70, 180)
- draw.OutlinedRect(3, 5, 179, 29)
- -- fps
- draw.SetFont(classicf)
- draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
- draw.Text(82, 11, "fps: ".. get_abs_fps())
- --ping
- local m_iPing = entities.GetPlayerResources():GetPropInt("m_iPing", client.GetLocalPlayerIndex())
- draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
- draw.Text(130, 11, "Ping: ".. m_iPing)
- -- text
- draw.SetFont(classicf)
- draw.Color(159, 202, 43, 230)
- draw.Text(15, 11, "gamesense")
- draw.Color(159, 202, 43, 230)
- draw.Text(74, 11, "|")
- draw.Color(159, 202, 43, 230)
- draw.Text(123, 11, "|")
- end
- callbacks.Register('Draw', 'use_Crayon', use_Crayon)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement