Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local control = script.Parent
- local remote = control:WaitForChild("DAMNFIRE")
- local debris = game:GetService("Debris")
- local tween = game:GetService("TweenService")
- local TIN = TweenInfo.new
- local animation -- keep this as it is
- local ballval = 0
- local holding = false
- local cooldown = false
- local cd_Time = 1
- local charge = 0
- local maxcharge = 10 -- maximum charge
- local damage = 1 -- base damage * fireball charge damage
- local burndamage = 5 -- burn damage
- function cvfx(ball:Instance)
- local rando = math.random(5,8)
- local a = Instance.new("Part",ball)
- a.Shape = Enum.PartType.Ball
- a.Material = Enum.Material.Neon
- a.Size = Vector3.new(rando,rando,rando)
- a.Name = "fireball-vfx"
- a.Transparency = 1
- a.Anchored = true
- a.CanCollide = false
- a.CanTouch = false
- a.Massless = true
- a.Parent = ball
- a.Color = Color3.new(1,1,1)
- a.CFrame = ball.CFrame
- local aud = script.chargeUp:Clone()
- aud.Parent = ball
- aud:Play()
- debris:AddItem(aud,aud.TimeLength + 1)
- charge = charge + 1
- tween:Create(a,TIN(1),{Color = ball.Color,Size = Vector3.new(.1,.1,.1),Transparency = 0}):Play()
- ball:WaitForChild("ParticleEmitter"):Emit(math.random(1,5))
- debris:AddItem(a,1.2)
- end
- function velocity(Part,Speed,Start,End)
- local vel = Instance.new("BodyVelocity",Part)
- vel.Velocity = CFrame.new(Start,End).LookVector * Speed
- vel.MaxForce = Vector3.new(5000,5000,5000)
- vel.P = 10000
- end
- function burn(Repeats,DamageDelay,Damage,Humanoid)
- coroutine.wrap(function()
- if Humanoid.Parent ~= nil then
- local checkforpart = Humanoid.Parent:FindFirstChildOfClass("Part")
- local particle = script.burnpe:Clone()
- if checkforpart then
- local aud = script.burn:Clone()
- aud.Parent = Humanoid.Parent:FindFirstChildOfClass("Part")
- aud:Play();debris:AddItem(aud,aud.TimeLength + 1)
- end
- for i = 1,Repeats do
- if Humanoid ~= nil and Humanoid.Parent ~= nil then
- Humanoid:TakeDamage(damage)
- checkforpart = Humanoid.Parent:FindFirstChildOfClass("Part")
- if checkforpart then
- local ouch = particle:Clone()
- ouch.Parent = Humanoid.Parent:FindFirstChildOfClass("Part")
- ouch:Emit(math.random(5,10))
- debris:AddItem(ouch,1)
- end
- end
- task.wait(DamageDelay)
- end
- end
- end)()
- end
- remote.OnServerEvent:Connect(function(p,v,m)
- local root = p.Character:FindFirstChild("HumanoidRootPart")
- local humanoid = p.Character:FindFirstChildOfClass("Humanoid")
- if p.Character ~= nil and root and humanoid then
- local animator = humanoid:FindFirstChildOfClass("Animator")
- if cooldown == false and animator then
- local info = string.lower(tostring(v))
- if animation == nil then
- animation = animator:LoadAnimation(control:WaitForChild("Animations").Charge)
- end
- if info == "fire" then
- cooldown = true
- coroutine.wrap(function()
- for l = 1,5 do -- repeat 3 times and stop animation
- animation:Stop()
- task.wait() -- a bit of delay
- end
- end)()
- local totalDmg = damage * charge -- damage multiplied by charge
- animator:LoadAnimation(control:WaitForChild("Animations").Fire):Play()
- local ball = root.Parent:FindFirstChild("fireball"..ballval)
- if ball then
- local hasHit = false
- ball.ParticleEmitter:Emit(math.random(5,10))
- ball.Transparency = 1
- debris:AddItem(ball,1)
- local ball2 = ball:Clone()
- ball2.Joint:Destroy()
- ball2.Name = ball.Name.."_projectile"
- ball2.Parent = root.Parent
- ball2.Position = ball.Position
- ball2.Anchored = false
- ball2.Transparency = 0
- local aud = script.fire:Clone()
- aud.Parent = ball2
- aud:Play()
- debris:AddItem(aud,aud.TimeLength + 1)
- for _,c in next,ball2:GetChildren() do
- if c:IsA("Part") then
- c:Destroy()
- end
- end
- for f,j in next,root.Parent:GetChildren() do
- if string.match(j.Name,"fireball") then --and not string.match("projectile",j.Name) then
- if not string.match(j.Name,"projectile") then
- if j ~= ball then
- debris:AddItem(j,.5)
- animation:Stop()
- end
- end
- end
- end
- debris:AddItem(ball2,10)
- velocity(ball2,100,ball2.Position,m)
- ball2.Touched:Connect(function(hit)
- if hasHit == false then
- local IGNORENAME = {"BASE","Base","Baseplate"} -- ignored hit parts name
- if hit and not table.find(IGNORENAME,hit.Name) then
- if hit.Parent ~= root.Parent and not string.match(hit.Name,"projectile") and not string.match(hit.Name,"vfx") then
- hasHit = true
- local ehum = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
- if ehum and ehum ~= humanoid then
- ehum:TakeDamage(totalDmg)
- burn(5,1,burndamage,ehum)
- end
- tween:Create(ball2,TIN(.45),{Transparency = 1,Size = Vector3.new(5,5,5)}):Play()
- debris:AddItem(ball2,.5)
- end
- end
- end
- end)
- end
- task.delay(cd_Time,function()
- cooldown = false
- charge = 0
- end)
- elseif info == "holding" then
- if holding == false then
- holding = true
- local ball = root.Parent:FindFirstChild("fireball"..ballval)
- if ball then
- if charge < maxcharge then
- cvfx(ball)
- charge = charge + 1
- end
- end
- task.delay(.5,function()
- holding = false
- end)
- end
- elseif info == "start" then
- if cooldown == false then
- local ball = script:WaitForChild("fireball"):Clone()
- ballval = ballval + 1
- ball.Parent = root.Parent
- ball.Name = ball.Name..ballval
- ball.Joint.Part0 = root.Parent:FindFirstChild("Right Arm")
- task.delay(.1,function()
- if holding == true then
- animation:Play()
- end
- end)
- end
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment