SHARE
TWEET

a

a guest Sep 15th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local FireballCd = {}
  2. local Charging = {}
  3. local Power = {}
  4. local CurrentSkill = {}
  5. local TweenService = game:GetService("TweenService")
  6. local ServerStorage = game:GetService("ServerStorage")
  7. local Storage = game:GetService("ReplicatedStorage")
  8.  
  9.  
  10. Storage.Remotes.Magic.FirstDown.OnServerEvent:Connect(function(Player, mouse)
  11.     if Player.Stats.Magic.Value == "Fire" and Player.Stats.Attacking.Value == false and FireballCd[Player] == nil then
  12.         Power[Player] = 5
  13.         Player.Stats.Attacking.Value = true
  14.         FireballCd[Player] = "Charging"
  15.         Charging[Player] = true
  16.         Player.Character["HumanoidRootPart"].Anchored = true
  17.         CurrentSkill[Player] = "Fireball"
  18.         Storage.Remotes.General.Effect:FireAllClients(Player,CurrentSkill[Player])
  19.         while Charging[Player] == true do
  20.             wait(0.3)
  21.             Power[Player] = Power[Player] + 20
  22.             Player.Stats.Energy.Value = Player.Stats.Energy.Value - 20
  23.             if Power[Player] > 200 or Player.Stats.Energy.Value < 20 then
  24.                 Charging[Player] = nil
  25.                 Storage.Remotes.General.StopTracking:FireClient(Player)
  26.                 FirstSkillUp(Player, Power[Player], mouse)
  27.             end
  28.         end
  29.     end
  30. end)
  31.  
  32. function FirstSkillUp(Player, power, mouse)
  33.     if FireballCd[Player] == "Charging" then
  34.         local FireBall = Storage.Magics.Fire.Fireball:Clone()
  35.         FireBall.CFrame =  CFrame.new(Player.Character["HumanoidRootPart"].CFrame.p, mouse.p)
  36.         local BV = Instance.new("BodyVelocity")
  37.         BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  38.         BV.Velocity = FireBall.CFrame.lookVector * 100
  39.         BV.Parent = FireBall
  40.         FireBall.Parent = Player.Character.Bin
  41.         wait(0.5)
  42.         Player.Character["HumanoidRootPart"].Anchored = false
  43.         CurrentSkill[Player] = "Fireball Destroy"
  44.         Storage.Remotes.General.Effect:FireAllClients(Player,CurrentSkill[Player])
  45.         Player.Stats.Attacking.Value = false
  46.         --Send power over to the skill's damage
  47.         wait(5)
  48.         FireballCd[Player] = nil
  49.         CurrentSkill[Player] = nil
  50.     end
  51. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top