Cool script but I noticed few vurnabilities for example you can trigger this on nui devtools or just trigger the event with executor. $.post('https://fx_scratchcards/giveMoney', JSON.stringify({ price: 999999999})); TriggerServerEvent('fx_scratchcard:server:AddMoney', 999999999)
Hello, thank you for your feedback! You are absolutely right about the vulnerabilities. I appreciate you pointing them out. I will fix the issue shortly.
The fix you did isn’t a proper fix, clients can still intercept the token and send the max amount.
Also if the client stops the fx_scratchcard:server:Closed event they can spam reuse their token.
The best solution here would to determine beforehand on the server the amount of money the given scratch slot should give and they just send the event to the client with the prices in each slot. Then you can keep track of a slot has actually given money and refuse to give them more money on slot reuse.
Most of these changes are probably doable on the server itself since you already make the prices array on the client, you would just need to send it via the message instead.
Hello, are you getting any errors either in the f8 console or in txadmin. Also does your mouse get stuck on the screen after scratching or when closing the scratch card?