I would like that as soon as he touches a player or a base my attack is destroyed
local FX = script.FX
local rp = game:GetService("ReplicatedStorage")
local remote = rp:WaitForChild("remote")
local TS = game:GetService("TweenService")
local RS = game:GetService("RunService")
local AttaqueModule = {}
function AttaqueModule.idk(Folder,Humrp,Character,Humanoid)
local part = FX.part:Clone()
part.CFrame = Humrp.CFrame * CFrame.new(0,100,80) * CFrame.Angles(-90,90,0)
part.Size = Vector3.new(.05,.0,5,.05)
part.Parent = Folder
TS:Create(part, TweenInfo.new(1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out
),
{
Size = Vector3.new(8.144, 239.392, 45.321)
}):play()
local vel = Instance.new("BodyVelocity", part)
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
vel.Velocity = part.CFrame.YVector * 250
part.Touched:connect(function(hit)
if hit:IsA("BasePart") then
if not hit:IsDescendantOf(Character) then
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid.Health > 0 then
part:Destroy()
end
end
end
end)
end
return AttaqueModule