Hello, I am trying to make an NUI callback so I can unfocus the NUI, but I can’t register it or something?
I can’t find the error so I decided to ask here!
client.ts
RegisterNuiCallbackType('exit')
on('_cfx_nui:exit', (data: any, cb: any) => {
console.log("exit")
cb("exit")
})
index.js
document.addEventListener('keydown', function(event) {
if (event.key==="Escape") {
$(".main").hide();
$.post("https://character_creator/exit", JSON.stringify({
type: "exit"
}));
console.log("sent");
}
});
I get the sent in the console, but the exit never arrives in the console
If you need any more information just tell me so in the comments