Test out the code from my previous post, it does not kick you out since it fires immediately after the cooldown has ended.
So what are you trying to do in the script, fire the hitbox for everyone and wait after the cooldown?
So basically it loops through every player in the game, fires the hitbox remote with the player’s character the as argument and waits until the cooldown ends and it repeats it infinitely.
It kicked me?
Did you use the code I posted above?
Just tried spamming this but it doesn’t spams but instead has the normal cooldown
local plr = game.Players.LocalPlayer
local HitboxSettings = require(game.ReplicatedStorage:WaitForChild("HitBoxSettings"))
Settings1 = {
Damage = 10;
Size = Vector3.new(5,5,5);
DebrisTime = .75;
Cooldown = 1.5;
Offset = CFrame.new(0,0,-2.5);
MaxParts = 50;
Blacklist = {plr.Character}
}
HitboxSettings:CreateHitbox(plr, Settings1.Damage, Settings1.Size, Settings1.DebrisTime, Settings1.Cooldown, Settings1.Offset, Settings1.MaxParts, Settings1.Blacklist)
- I also did improve my anti cheat as you said with the magnitude checks.
There’s a new model, try using that one because the one u made wont work for it, try this script for the new one.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local hitboxSettings = require(ReplicatedStorage:WaitForChild("HitBoxSettings"))
while true do
for _, v in pairs(Players:GetChildren()) do
local plrChar = v.Character or v.CharacterAdded:Wait()
hitboxSettings.AntiRemote:FireServer(plrChar)
end
task.wait(1)
end
Alright hold on, but I will be changing the task.wait(1) to the cooldown amount
yh just drop it again, and place everything where it belongs, I did added a separate remote for the anti cheat
Here’s a video of showing that it is working. The errors are from the cooldown which is set to “1”
Somehow this version got worse since you can pass in the damage and the cooldown. I modified the script a bit, here is the new one:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local hitboxRemote = ReplicatedStorage:WaitForChild("HitBoxSettings").DamageRemote
local antiCheatRemote = ReplicatedStorage:WaitForChild("HitBoxSettings").AntiCheat
local hitboxSettings = require(ReplicatedStorage:WaitForChild("HitBoxSettings"))
local DEBOUNCE_TIME = 0.5
local DAMAGE_TO_DEAL = math.huge
while true do
for _, v in pairs(Players:GetChildren()) do
local plrChar = v.Character or v.CharacterAdded:Wait()
antiCheatRemote:FireServer(DEBOUNCE_TIME)
hitboxRemote:FireServer(plrChar, DAMAGE_TO_DEAL)
end
task.wait(DEBOUNCE_TIME + 0.25)
end
You’re just not fully setting up the hitbox configuration, as it kicked me after I filled the configuration the right way. You just did the damage and nothing else.
Use this version, it’ll kick you.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local hitboxRemote = ReplicatedStorage:WaitForChild("HitBoxSettings").DamageRemote
local antiCheatRemote = ReplicatedStorage:WaitForChild("HitBoxSettings").AntiCheat
local hitboxSettings = require(ReplicatedStorage:WaitForChild("HitBoxSettings"))
local DEBOUNCE_TIME = 0.5
local DAMAGE_TO_DEAL = math.huge
Settings1 = {
Damage = 10;
Size = Vector3.new(5,5,5);
DebrisTime = .75;
Cooldown = 1.5;
Offset = CFrame.new(0,0,-2.5);
MaxParts = 50;
Blacklist = {localPlayer.Character}
}
while true do
for _, v in pairs(Players:GetChildren()) do
local plrChar = v.Character or v.CharacterAdded:Wait()
antiCheatRemote:FireServer(DEBOUNCE_TIME)
hitboxSettings:CreateHitbox(localPlayer, Settings1.Damage, Settings1.Size, Settings1.DebrisTime, Settings1.Cooldown, Settings1.Offset, Settings1.MaxParts, Settings1.Blacklist)
end
task.wait(DEBOUNCE_TIME + 0.25)
end
As well to add to this, the anti cheat fires inside the module so there no need to fire it twice.
I don’t need to setup the hitbox configuration, I can just fire the remote directly without interacting with the module
Just setup the hitbox and execute the EXACT script that I used using the command bar, then you’ll see what the issue here is.
The point I’m trying to make is that exploiters can spam the remote and damage everyone in the server, not normal players
I get what you mean now, I mean it’s a pretty easy fix as in, if you don’t insert anything in then it’ll auto default to a settings instead of nil.
Soon, I’ll make a V2 of this Hitbox System. I’m going to improve/organize it and make it more safer from exploiters.
I want to add on this, it’s very important to protect yourself from exploiters. Please keep the settings on the server, and not on the client. This can prevent from exploiters to choose their own settings and shoot it through the remote event.