Advertisement
Sungmingamerpro13

New BossFight System But Break In Story Style

Jan 22nd, 2025
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.10 KB | None | 0 0
  1. function BossFight_System(NPCName)
  2.     local Boss_Monster = workspace[NPCName]
  3.    
  4.     local function playMonsterAnimation()
  5.         local animation = Instance.new("Animation",Boss_Monster)
  6.         animation.AnimationId = "https://roblox.com/assets/?id=1083195517"
  7.  
  8.         local humanoid = Boss_Monster:FindFirstChild("Humanoid")
  9.         humanoid:LoadAnimation(animation):Play()
  10.  
  11.         wait(1)
  12.  
  13.         animation:Destroy()
  14.     end
  15.  
  16.     local function playMonsterAttackAnimation()
  17.         local animation = Instance.new("Animation",Boss_Monster)
  18.         animation.AnimationId = "https://roblox.com/assets/?id=115300646506302"
  19.  
  20.         local humanoid = Boss_Monster:FindFirstChild("Humanoid")
  21.         humanoid:LoadAnimation(animation):Play()
  22.  
  23.         wait(1)
  24.  
  25.         animation:Destroy()
  26.     end
  27.    
  28.     local function fireballchallenge()
  29.         for i=1,3 do
  30.  
  31.             playMonsterAnimation()
  32.  
  33.             playMonsterAttackAnimation()
  34.  
  35.             for i,player in pairs(game.Players:GetPlayers()) do
  36.                 if player.Character then
  37.                     local fireball = game.ReplicatedStorage.Fireball:Clone()
  38.                     local target = game.ReplicatedStorage.Target:Clone()
  39.  
  40.  
  41.                     target.Parent = game.Workspace
  42.                     target.CFrame = (player.Character.HumanoidRootPart.CFrame - Vector3.new(0,3,0)) * CFrame.Angles(0,0,math.rad(90))
  43.  
  44.                     wait(0.5)
  45.  
  46.                     fireball.Parent = game.Workspace
  47.                     fireball.CFrame = target.CFrame + Vector3.new(0,60,0)
  48.  
  49.                     wait(2)
  50.  
  51.                     target:Destroy()
  52.                 end
  53.             end
  54.  
  55.             wait(1)
  56.         end
  57.     end
  58.    
  59.     local function Boss_Minions()
  60.        
  61.         local MinionsModel = game.ReplicatedStorage.BossMinions:Clone()
  62.         MinionsModel.Parent = workspace
  63.        
  64.         wait(10)
  65.        
  66.         MinionsModel:Destroy()
  67.        
  68.     end
  69.    
  70.     while wait(5) do
  71.         if Boss_Monster.Humanoid.Health > 0 then
  72.            
  73.             Boss_Monster.ForceField.Visible = true
  74.             Boss_Monster.SelectionBox.Visible = false
  75.             Boss_Monster.ClickScript.Disabled = true
  76.            
  77.             fireballchallenge()
  78.             Boss_Minions()
  79.            
  80.             Boss_Monster.ClickScript.Disabled = false
  81.             Boss_Monster.SelectionBox.Visible = true
  82.             Boss_Monster.ForceField.Visible = false
  83.            
  84.         else
  85.             break
  86.         end
  87.     end
  88.    
  89.     repeat wait(0.1) until Boss_Monster.Humanoid.Health == 0
  90.    
  91.     Boss_Monster:Destroy()
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement