I still can't make a fire ball do damage?!
Asked by
5 years ago Edited 5 years ago
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
01 | local Plr = game:GetService( "Players" ).LocalPlayer |
02 | local tool = script.Parent |
03 | local FireBallAttack = game.ReplicatedStorage:WaitForChild( "FireBallCollisions" ) |
06 | tool.Activated:connect( function (Player) |
08 | local FireBall = Instance.new( "Part" ) |
09 | FireBall.Shape = "Ball" |
10 | FireBall.BrickColor = BrickColor.new( "Maroon" ) |
11 | FireBall.Transparency = 0.5 |
12 | FireBall.TopSurface = "Smooth" |
13 | FireBall.BottomSurface = "Smooth" |
14 | local Fire = Instance.new( "Fire" ) |
15 | Fire.Parent = FireBall |
16 | FireBall.CFrame = Plr.Character.HumanoidRootPart.CFrame * CFrame.new( 0 , 0 ,- 6 ) |
17 | local BodyVelocity = Instance.new( "BodyVelocity" ) |
18 | BodyVelocity.Velocity = Plr.Character.HumanoidRootPart.CFrame.LookVector * 90 |
19 | BodyVelocity.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
20 | BodyVelocity.Parent = FireBall |
21 | local Explosion = Instance.new( "Explosion" ) |
22 | FireBall.Parent = workspace |
24 | game:GetService( "Debris" ):AddItem(FireBall, 10 ) |
26 | local ClonedFireBallAttck = FireBallAttack:Clone() |
27 | ClonedFireBallAttck.Parent = FireBall |
33 | script.Parent:Destroy() |
And now here's the 2nd script in replicated storage
2 | if hit.Parent.hit:FindFirstChild( "Humanoid" ) then |
3 | hit.Parent.Humanoid:TakeDamage( 20 ) |
4 | script.Parent.CanCollide = false |
9 | script.Parent.Touched(OnTouch) |
If you can answer this then thx.