Passing info from lua to javascript

what do I do on the javascript side to make args[1] work?

RegisterCommand('cash', function(source, args, rawCommand)
    SendNUIMessage({
        test = args[1]
    })
end)

i am trying to set it so when someone does /cash 100 it will say 100 in here https://gyazo.com/3c8f2c22d70fe3d757991b0af2487b22

(NOT ESX, DONT SPAM)

So when you’re passing that NUIMessage, the Javascript should be something like

variable ABC123Whatever = event.data.test

So you’d set that datatype to whatever HTML you have set up. You should be able to get an idea of what I’m saying from the link I posted above. If for some reason it’s just the args[1] that isnt working you could do this. But I don’t see why you would.

RegisterCommand('cash', function(source, args, rawCommand)
local cash = args[1]
    SendNUIMessage({
        test = cash
    })
end)

i thougt i tried that but thanks will check it.

Is the javascript listening for the event.data? Like uh

window.addEventListener 

it worked with the first comment thanks

Awesome.

inset 20 char here