Hey, I’m new here and get stuck on basics
Want to use JS but for the beginning, I try to build own resource reading this tutorial https://forum.cfx.re/t/how-to-create-a-basic-script/3380
and after I make it working I try to transpile to JavaScript with help from documentation
https://docs.fivem.net/scripting-reference/events/client-events/
https://docs.fivem.net/scripting-manual/working-with-events/listening-for-events/
and I cannot make it to work
Here is the code I have written
__resource.lua
resource_manifest_version '1159-eba1701f1961f652c9d7f2033ee0dc156c1dc5d5'
client_script 'client.js'
client.js
const event = (a, b) => {
console.log('test' a, b);
emit("chat:addMessage", {
color = { 255, 0, 0},
multiline = true,
args = {"Me", "Please be careful to not step on too many snails!"}
});
};
on("baseevents:onPlayerWasted", event);
on("baseevents:onPlayerDied", event);