Help with NUI

Guys i need some help with nui:

I have this callback on my client.js:

on("__cfx_nui:takemoney", (data, cb) => {
	//var amount = 200;
	emitNet("blackjack:betta", amount);
	console.log("funzika tuto");

and on the script.js, that is the NUI script, i have this function

this.TakeMoney = function(amount) {
		self.myTurn = true;
		console.log("chiamata a takemoney");
		$.post('http://blackjack/takemoney', amount);

Now i was wondering: is there a way to transfer the value of amount from the nui (where i have the value and use in the client.js to call a .lua event?

data in your callback should contain the amount of money, if not try sending it in a JSON representation.

It’s considered bad and unsafe design to let the client send the money they won, you should implement all your logic on the server else your server is vulnerable for attackers.

Wait… attackers? :worried: Because that is just 1 callback for a blackjack payment system. btw ty. Just how can i get the “amount” on the client.js