I have remote event security.
It will be communicating by security code.
The client, is printing nil after doing FireServer() on the remote.
However, when printing the security code after generating it, it does not print nil surprisingly.
RemoteEvent:FireServer does not return anything. Did you meant to use a RemoteFunction and use RemoteFunction:InvokeServer instead? Either way I recommend an authoritative server rather than sending an obfuscated key.
To get data from a remote you must use RemoteFunctions and invoke them. SAMPLE
-- client
local rf = game.ReplicatedStorage.RemoteFunction
local key = rf:InvokeServer()
-- server
local rf = game.ReplicatedStorage.RemoteFunction
rf.OnServerInvoke = function()
return -- whatever
end
By the way, I’m pretty sure exploiters would just extract the key with __namecall if need be so there’s no security in doing this.
Yes, I know how to use remotefunctions already, don’t need to have a sample, but thanks.
But thats the thing, it will return modules to the local scripts and if the remote functions or remote events or whatever is fired more than once, the player gets banned.
__namecall can be used by exploiters to catch the key when the server returns it anyway. They don’t need to invoke the server to get a key, they can literally track the key through metatables. If you want true security, secure your remotes on the server-side where exploiters have no control over. In any case, the reason why your thing is printing nil is because remoteevents can’t return data.
It will return modules to the local script to use only once.
After recieving, there’s no need to fire the remote again.
So if it’s fired again, the player will get banned because it’s being fired more than once.
Unless they auto-execute on the game join, they cant track it.
__namecall does not involve refiring the remote. It involves tampering with the remote on the client side and effectively allows exploits to collect data sent through it without firing the remote again. Again, you’re wasting your time doing this but again, responding to your issue, it’s because you are using a RemoteEvent. If you need more clarification on what I’m saying, pm me.