When i add part.Anchored = true, its not activating the part.Touched thing or something idk. But when i remove the part.Anchored = true, its now giving damage. How do i true the anchor and give damage? What is the problem?
local Attack = true script.Parent.Activated:Connect(function() wait(0.1) if Attack == true then Attack = false local character = script.Parent.Parent local Humanoid = character:WaitForChild('Humanoid') local torso = character:WaitForChild('HumanoidRootPart') local part = Instance.new("Part", game.Workspace) part.Size = Vector3.new(7.3, 4 ,3) part.Anchored = true part.CanCollide = false part.Transparency = 0.5 part.CFrame = torso.CFrame+(torso.CFrame.lookVector*3) part.Touched:Connect(function(p) local hum = p.Parent:FindFirstChildOfClass("Humanoid") if p.Parent.Name == ("Mob") then if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false hum:TakeDamage(20) wait(0.5) script.Parent.CanDamage.Value = true end end end) wait(0.15) part:Destroy() wait(0.5) Attack = true end end)