How should i secure FireAllClients

You can write your topic however you want, but you need to answer these questions:

  1. **What do you want to achieve?
    I want to make it like in server which is cant fire when the statement is false

  2. **What is the issue?
    Hackers can able to modify my script like making instance or changing boolean etc.

  3. **What solutions have you tried so far?
    I tried to make boolean that cant be fired when the statement is not true

–Heres an example of my script.

game:GetService(‘ReplicatedStorage’).Replicator.OnClientEvent:Connect(function(Player,Firing)
if Firing ~= true then
local Bullet = instance.new(“Part”,workspace.Debris)
Bullet.CFrame = HRP.CFrame + HRP.CFrame.lookVector * 0.1
Bullet.Anchored = true
local NTenTarget = HRP.CFrame + HRP.CFrame.lookVector * 50
local Fire= TweenS:Create(Bullet, TweenInfo.new(0.5, 3, 0), {
CFrame = H
})
Fire()
return Bullet
end
end)

Try using Remote Functions instead of remote events. In this case, you can check on the player on the server and the player can be permanently suspended from firing if the server does not return for a really long time after checking that their values are not correct.