As the title said,
First heres my code :
function module.DefaultHit(Info)
local self = setmetatable({}, module
self.BPD = Info.BypassDefense or 0
self = Setup(self, Info)
local Hitbox = MakeHb(Info, true)
local hitchar = {}
local Victims
local idk, overlap = Zone(Info, Hitbox.CFrame, Hitbox.Size)
for i, p in pairs(idk) do
if p.Parent:FindFirstChild("HumanoidRootPart") and p.Parent.Name ~= Info.Char.Name and not p.Parent:GetAttribute(AvoidAttributes[1]) --[[and accept == false]] and p.Parent:FindFirstChild("Torso") and p.Parent:FindFirstChildOfClass("Humanoid") and not table.find(hitchar, p.Parent) then
if p.Parent.Humanoid.Health > 0 then
table.insert(hitchar, p.Parent)
self.VictimHrp = p.Parent.HumanoidRootPart
task.spawn(function()
self.HitStyle = Info.HitStyle
if self.HitStyle then
module:SetHit(self.HitStyle, self.VictimHrp)
end
end)
--//Funcs\\--
SetDmg(Info, p, self.BPD, self.cc, self.cd) -- Function that caculate dmg
AddSound(p.Parent.HumanoidRootPart, Info.Sound)
CreateVelocity(Info, p) -- Knock back func
CreateStun(Info, p)
end
end
end
overlap:AddToFilter(hitchar)
return self
end
Second:
-the module in the studio works great but in being laggy in game : when the client send the
hit event which is an remote event to the server then to the module which delayed the progress
Any help is appreciated!,
is there anyway to shorten the progress?