[How to] Use colors in lua scripting

:joy: my bad. Then it would be black.

how do you reset the bold text ? because from my experience and trial and error you can’t :confused:

1 Like

just use ^r in the end of formatting!

It’s different with the GTA 5 colors, doing ^r would work for chat formatting. To reset bold, do this: This is some text, ~h~this is bold~h~, this is not.

@TheSparta, hope this helps.

1 Like

A little late ahahah, i dont even remember what i wanted this for, but i think i figured it out after posting that, thx anyways @DannyP and @zee

2 Likes

would like to use hex or rgb is possible? the line is this:
drawTxt(0.3, 1.4, 0.45, '~s~ID#: ~o~ ' .. GetPlayerServerId(PlayerId()), 255, 255, 255, 255)

I Want to add color to a locale script,

[‘not_enough_medikit’] = ‘You do not have ~b~medikit~s~.’,

I have the colors everything is fine, but i need bloody red, or how to add rgb color.

use ~r~ for red

and ~s~ for close color
for example ~r~Hello~s~ World
the Hello is Red and the World white default

How I can stop a bold text ?

image

In the following example ~h~this is bold~h~ and this is not.

as chat is mostly a NUI (Html…) you could change it via Jquery or CSS

What’s the script for the color text in game