I'm trying to create a melee weapon with a "damage radius" around the player. The welding however, causes the player to glitch out every time I use the weapon. Any help?
local DamageObject = Instance.new("Part") DamageObject.Parent = workspace DamageObject.Name = Player.Name.."'s DamageObject" DamageObject.Shape = Enum.PartType.Ball DamageObject.Anchored = false DamageObject.CanCollide = false DamageObject.Size = Vector3.new(10, 10, 10) DamageObject.Position = workspace[Player.Name].UpperTorso.Position local weld = Instance.new("Weld") weld.Parent = DamageObject weld.Name = "Weld" weld.Part0 = workspace[Player.Name].LowerTorso weld.Part1 = DamageObject weld.C0 = workspace[Player.Name].UpperTorso.CFrame:Inverse() weld.C1 = DamageObject.CFrame:Inverse() DamageObject.Touched:Connect(function(Part) local Humanoid = Part.Parent:FindFirstChild("Humanoid") if Part.Parent:FindFirstChild("Humanoid") and table.find(IgnoreList, Part.Parent.Name) == nil then if Part.Parent:FindFirstChild("Died") == nil then ReplicatedStorage.DamageEvent:Fire(Player, Part.Parent.Humanoid, 25) table.insert(IgnoreList, 1, Part.Parent.Name) end if Humanoid.Health <= 0 then local DeathMarker = Instance.new("Folder") DeathMarker.Name = "Died" DeathMarker.Parent = Part.Parent end end end) wait(0.5) DamageObject:Destroy() IgnoreList = {}
you could make the part massless, i have done that before it works.
part.Massless = true