Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Barrage Hitbox lags alot whats alternative?

Asked by 3 years ago

Hello, I have been working on a barrage system but I don't really know how to make the hitbox this is my current hitbox but its extremely lagy and destroys all fps

01local function Detected(char)
02    wait(.8)
03    local hitbox = script.Meshes.HitBox:Clone()
04    hitbox.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
05    hitbox.Parent = game.Workspace
06    game.Debris:AddItem(hitbox,.08)
07 
08 
09    local weld = Instance.new("ManualWeld")
10    weld.Part0 = hitbox
11    weld.Part1 = char.HumanoidRootPart
12    weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
13    weld.Parent = weld.Part0
14 
15    local connection
View all 48 lines...

Answer this question