Securing RemoteEvent by checking Which script that fires the remoteEvent

Hi, this is just a quick question. Would the RemoteEvent secured if i do like this?

Local Script:

RemoteEvent:FireServer(script)

Script:

RemoteEvent.OnServerEvent:Connect(function(player,Key)
 if Key ~= .... then return end -- Check which script fires the RemoteEvent
 -- Rest of codes
end)

No. An exploiter can fire it with the same argument just like you did.
Besides, you shouldn’t try to prevent exploiters from firing your remotes. Instead, focus on making them impenetrable: if you have a reload remote, check if the player has enough ammo. If you have a shoot remote, check if the player isn’t trying to shoot through walls.

2 Likes

What if i check the script Parent? Because parent of local script from exploiter is nil

You misunderstood me.
If your localscript is stored at game.Players.Firzal_VX.PlayerGui.LocalScript, the exploiter can just use that as the remote argument. The server receives the instance, not the name of the variable.

And again, you shouldn’t be trying to do this in the first place. Just have proper sanity checks on the server, and don’t handle crucial stuff on the client.

1 Like

Oh… Seems there’s no way to completely secure the RemoteEvent, thanks for the answers, I get what you says now.