How can I make events safe against abuse by menus? / Difference between ("RegisterNetEvent") and ("RegisterServerEvent")?

Hello Guys,
I am very new in the development scene here at FiveM.

And I wanted to ask if it is possible to secure events against abuse by several menus that can trigger them about their NUI for example and how I can secure them (if possible).

Also I scrolled a bit at the documentation and saw that there are also events that are: ‘over the network’ (“RegisterNetEvent”).
What does that actually mean and are these ‘over the network’ events more vulnerable then ‘normal’ (“RegisterServerEvent”) events?
And what is the special case where I need to use the ‘over the network’ events instead of the ‘normal’ events?

Please understand certain things that I may not have understood and explain them to me instead of beating me up, thanks!

Kind regards

RegisterNetEvent is the client side version of RegisterServerEvent, if you didnt add “RegisterNetEvent” To a client event, then it would say TRIGGER isnt safe for net, basically implying that the event will not register nor trigger.

1 Like

Nope. RegisterServerEvent is the old and deprecated name for RegisterNetEvent.

Over the network events are events that can be triggered…well…over the network. So, server events that can be triggered from the client, and vice-versa. They are the main communication line between server and client scripts.

Just don’t trust the client. There are a lot to talk about securing scripts against lua executors, but the main point is: Client should not decide data change!

This topic is still valid: How hackers can exploit your servers and what to do about it

1 Like