Advertisement
VicyX

Star Wars:Space Battles Script Functions

Mar 31st, 2020
3,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.61 KB | None | 0 0
  1. -- This is just all the 'if' statements so you dont need to copy a long script
  2.  
  3. function Init()
  4.     local Players = game:GetService('Players')
  5.     local Player = Players.LocalPlayer
  6.     local PlayerF = Player.Team
  7.     local Dam = 10000
  8.    
  9.     if _G.Kill_Enemy_Players == true then
  10.         for i,v in pairs(Players:GetChildren()) do
  11.             local Event = game:GetService("ReplicatedStorage").PDmgEvent
  12.             if v.Team ~= Player.Team then
  13.                 Event:FireServer(workspace:FindFirstChild(Player.Name):FindFirstChildOfClass('Tool'), Dam, workspace:FindFirstChild(v.Name).Humanoid)
  14.             end
  15.         end
  16.     end
  17.     if _G.Kill_Friendly_Players == true then
  18.         for i,v in pairs(Players:GetChildren()) do
  19.             local Event = game:GetService("ReplicatedStorage").PDmgEvent
  20.             if v.Team == Player.Team and v ~= Player then
  21.                 Event:FireServer(workspace:FindFirstChild(Player.Name):FindFirstChildOfClass('Tool'), Dam, workspace:FindFirstChild(v.Name).Humanoid)
  22.             end
  23.         end
  24.     end
  25.     if _G.Destroy_Enemy_Ships == true then
  26.         for i,v in pairs(Players:GetChildren()) do
  27.             local Event = game:GetService("ReplicatedStorage").ShipDmgEvent
  28.             if v.Team ~= Player.Team then
  29.                 Event:FireServer(v, Dam)
  30.             end
  31.         end
  32.     end
  33.     if _G.Destroy_Friendly_Ships == true then
  34.         for i,v in pairs(Players:GetChildren()) do
  35.             local Event = game:GetService("ReplicatedStorage").ShipDmgEvent
  36.             if v.Team == Player.Team and v ~= Player then
  37.                 Event:FireServer(v, Dam)
  38.             end
  39.         end
  40.     end
  41.     if _G.Destroy_Enemy_Cruiser == true then
  42.         local TargShip
  43.         if Player.Team.Name == 'CIS' then
  44.             TargShip = 'Republic'
  45.         else
  46.             TargShip = 'CIS'
  47.         end
  48.         for i,v in pairs(game:GetService("Workspace")["CriticalPoints_"..TargShip]:GetChildren()) do
  49.             local Event = game:GetService("ReplicatedStorage").DamageCP
  50.             Event:FireServer(v, Dam)
  51.         end
  52.     end
  53.     if _G.Destroy_Friendly_Cruiser == true then
  54.         for i,v in pairs(game:GetService("Workspace")["CriticalPoints_"..Player.Team.Name]:GetChildren()) do
  55.             local Event = game:GetService("ReplicatedStorage").DamageCP
  56.             Event:FireServer(v, Dam)
  57.         end
  58.     end
  59.     if _G.Kill_Specific_Player ~= 'NAME' then
  60.         local TargPlayer
  61.         for i,v in pairs(Players:GetChildren()) do
  62.             if string.match(string.lower(v.Name), string.lower(_G.Kill_Specific_Player)) then
  63.                 print('Player Found | '..v.Name)
  64.                 TargPlayer = v
  65.                 break
  66.             end
  67.         end
  68.         local Event = game:GetService("ReplicatedStorage").PDmgEvent
  69.         Event:FireServer(workspace:FindFirstChild(Player.Name):FindFirstChildOfClass('Tool'), Dam, workspace:FindFirstChild(TargPlayer.Name).Humanoid)
  70.         local Event = game:GetService("ReplicatedStorage").ShipDmgEvent
  71.         Event:FireServer(TargPlayer, Dam)
  72.     end
  73. end
  74.  
  75. Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement