Ok, I maked a script that when sending a signal to the remove event, the remove event returns the signal and check if script is sending by the local script, for example:
SCRIPT1 (CLIENT):
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local secState = false
mouse.Button1Down:Connect(function()
secState = true
game.ReplicatedStorage.ExampleRemote:FireServer()
end)
game.ReplicatedStorage.ExampleRemote:Connect(function()
if secState == false then
plr:Kick()
else
secState = false
end)
SCRIPT (SERVER)
game.ReplicatedStorage.ExampleRemote.OnServerEvent:Connect(function(plr)
game.ReplicatedStorage.Example:FireClient(plr)
end)
More to protect the Script1 in client, I maked other script called Script2 can detect if Script1 is deleted, and I create other line code in Script1 what detects if the Script2 is deleted, and kick the player, for example:
SCRIPT1 (CLIENT) NEW LINE CODE:
script.Parent.Script2.Destroying:Connect(function()
plr:Kick('Hack')
end)
SCRIPT2 (CLIENT):
local plr = game.Players.LocalPlayer
script.Parent.Script1.Destroying:Connect(function()
plr:Kick('Hack')
end)
Exploiters can break this system?