I've asked this question before and I did what those kind people told me but, it still didn't work. I have 2 scripts to make a quote on quote "FireBall" when shot out from and tool and hits an enemy with a Humanoid it does damage to it. The first script is in the tool.
Here's the first one
local Plr = game:GetService("Players").LocalPlayer
local tool = script.Parent
local FireBallAttack = game.ReplicatedStorage:WaitForChild("FireBallCollisions")
local Ammo = 5
tool.Activated:connect(function(Player)
local FireBall = Instance.new("Part")
FireBall.Shape = "Ball"
FireBall.BrickColor = BrickColor.new("Maroon")
FireBall.Transparency = 0.5
FireBall.TopSurface = "Smooth"
FireBall.BottomSurface = "Smooth"
local Fire = Instance.new("Fire")
Fire.Parent = FireBall
FireBall.CFrame = Plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-6)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Velocity = Plr.Character.HumanoidRootPart.CFrame.LookVector * 90
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BodyVelocity.Parent = FireBall
local Explosion = Instance.new("Explosion")
FireBall.Parent = workspace
--Add Fireball to debris (will be destroyed after 60 seconds)
game:GetService("Debris"):AddItem(FireBall,10)
local ClonedFireBallAttck = FireBallAttack:Clone()
ClonedFireBallAttck.Parent = FireBall
Ammo = Ammo - 1
print(Ammo)
if Ammo == 0 then
script.Parent:Destroy()
end
end)
And now here's the 2nd script in replicated storage
function OnTouch(hit)
if hit.Parent.hit:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(20)
script.Parent.CanCollide = false
script.Parent:Destroy()
end
end
script.Parent.Touched(OnTouch)
If you can answer this then thx.

1 comment
Is the damage script disabled when cloned to the part?