visuals
Restyle Starlit's own player ESP one player at a time: hide or recolour parts, add text lines and bars, and change the colour and material of chams and the colour of glow.
On this page
visuals styles the player ESP for single players. A script can hide or recolour the box, the skeleton, the bars, the name, the weapon, the flags and the arrow, add its own text lines and bars to the ESP stacks, and restyle the colour and material of the chams and the glow colour of an enemy or a teammate. The user keeps every setting. The script lays its look on top, one frame at a time.
Scripts run just before the ESP draws, so what a script sets shows in the same frame. Call everything from events.on_paint.
Styling a player
Ask for a handle with visuals.player(slot), then call methods on it. The slot is the player's slot, 1 to 64, from entity or game.players().
local v = visuals.player(slot)
v:hide("name", true)
v:color("box", 255, 60, 60)
v:text("top", "35 hp", 255, 120, 120)
The handle is good for the frame it was made in. Ask again every frame.
| part | hide | color |
|---|---|---|
"box" | yes | yes |
"skeleton" | yes | yes |
"health" | yes | "health_full" and "health_low", the two ends of the health bar |
"ammo" | yes | |
"name" | yes | yes |
"weapon" | yes | yes |
"flags" | yes | |
"arrow" | yes | yes |
"all" | yes, and it also covers the player's chams and glow |
How the calls behave
- Return values. Every method returns
truewhen it took effect andfalsewhen it did not: a name that is not on the lists, a full stack, a player that has left. - Errors. A wrong type or a number that is not finite (
nan,inf) raises an error with a fixed text. An unknown part, place or style name is answered withfalse. - Numbers. Colours are 0 to 255 and rounded, and the alpha is 255 when left out.
fractionis clamped to 0 to 1. - Lifetime. What a script sets lasts for the frame it was set in and the next one. A script that keeps calling every frame keeps its look. One that stops, because it ends, stops with an error or is unloaded, hands the players back to the user's own look within two frames.
- Several scripts. The script that wrote a player last owns that player's entry for the frame.
- Limits. 1024
visualscalls per script and frame, 64 distinct players, and per player 4 text lines and 2 bars. - Fonts. Text is drawn in the ESP's own fonts: the name face above and below the box, the small face on the right.
Cost visuals.player 30 instructions. Methods: hide, color and glow 25, bar 30, text and chams 40, reset 20.
Functions
visuals.player
visuals.player(slot) -> handle or nil
| argument | type | meaning |
|---|---|---|
slot | integer | the player's slot, 1 to 64 |
Returns a handle for a living player who is not yourself, or nil.
v:hide
v:hide(part, flag) -> boolean
part is "box", "skeleton", "health", "ammo", "name", "weapon", "flags", "arrow" or "all". true takes the part out of the player's ESP and false puts it back. "all" covers every part and also the player's chams and glow.
v:color
v:color(part, r, g, b [, a]) -> boolean
part is "box", "skeleton", "name", "weapon", "health_full", "health_low" or "arrow". It replaces the colour of that part.
v:text
v:text(where, str, r, g, b [, a]) -> boolean
Adds a line of text to the ESP. where is "top" (stacked above the name), "bottom" (below the weapon) or "right" (continuing the flag column). A player has up to 4 lines, each up to 24 bytes. Longer text is cut.
v:bar
v:bar(where, fraction, r, g, b [, a]) -> boolean
Adds a thin bar beside the box, in the stack of the health bar. where is "left", "top" or "bottom". fraction is 0 to 1. A player has up to 2 bars.
v:chams
v:chams(layer, style, r, g, b, a [, through_walls]) -> boolean
| argument | meaning |
|---|---|
layer | 1 or 2. Layer 1 is the primary chams layer, drawn where the player is visible. Layer 2 is the secondary layer, drawn through walls. |
style | a style name from the list below |
r, g, b, a | the colour, 0 to 255 |
through_walls | picks the through-wall twin of the style. The default is false for layer 1 and true for layer 2, like the pair in the menu. |
Restyles one of the two main chams layers that the user has switched on. A layer the user has switched off stays off.
Style names: matte, outlines, distortion, and the styles of the chams menu: regular, flat, bloom, glow, latex, glass, flow, spiral, cosmic, galaxy, neon, data, aurora, obsidian, nova, astral rift, orbit veil, plasma eclipse, prism bloom, starfall grid, void singularity, metallic, electric, hologram, liquid, pearl.
v:glow
v:glow(r, g, b, a) -> boolean
Colours the glow of that player, when the user has the glow of that target switched on.
v:reset
v:reset() -> boolean
Takes back everything this script set for the player in this frame.
Example: low health
Enemies on low health get a red box and an hp line above the name.
events.on_paint(function()
for _, p in ipairs(entity.players()) do
if p:is_enemy() and p:is_alive() then
local hp = p:get("health") or 100
if hp <= 35 then
local v = visuals.player(p:index())
if v then
v:color("box", 255, 60, 60)
v:text("top", hp .. " hp", 255, 120, 120)
end
end
end
end
end)
Example: visible and hidden chams
The primary layer, shown where the enemy is in view, goes green. The secondary layer, shown through walls, goes red, and the glow follows it.
events.on_paint(function()
for _, p in ipairs(entity.players()) do
if p:is_enemy() and p:is_alive() then
local v = visuals.player(p:index())
if v then
v:chams(1, "flat", 80, 255, 120, 255)
v:chams(2, "flat", 255, 90, 60, 160, true)
v:glow(255, 90, 60, 90)
end
end
end
end)