How to detect if a value isn't the same in local and server

so i’m implementing a data system in my game and,

i want to prevent exploiters from changing their value and i want it to kick them if they ever try to
change it

my idea is that since they can’t change a value on the server i want it to detect if it’s not the same value on local and server

Just do a simple check whenever you try to send requests to the server. You don’t need to worry about them changing it as they can’t (unless you are changing data through RemoteEvents/Functions which is best to avoid).

If you do use RemoteEvents/Functions, you can implement your own anti-cheat (though it depends on how YOU make the SERVER do the job).

You might try using something like this:

local object = — path to object which is holding a value
local remote = — path to remote event


Now a remote event is fired. React to it using a Script.

local remote = — path to remote event
local object = — path to same object in LocalScript

remote.OnServerEvent:Connect(plr, val)
    if object.Value == val then return end — legitimate change
    — reaction to unlegitimate change
    plr:Kick(“Usage of illict third party software detected.“)