Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1.  
  2. _G.settings = {
  3. ["Difficulty"] = "Insane", --You know what this means lawl
  4. ["AttackName"] = "Soldier", --What uh 'attacker' you want 2 spawn
  5. ["SpawnPer"] = 2, --This is how long it will wait till it tries 2 spawn another uh 'attacker'
  6. }
  7.  
  8. _G.Upgrade_settings = {
  9. ["WaitTillUnitNum"] = 5, --This will not upgrade any 'attackers' untill you have this many units on the field
  10. ["UpgradePer"] = 10 --This is how long it will wait till it tries 2 upgrade your uh 'attackers' (like every single one)
  11. }
  12.  
  13. _G.Fram_settings = {
  14. ["On"] = false, --On and off button
  15. ["FarmName"] = "Farm", --If you wanna spawn farms (outside the map)
  16. ["SpawnPer"] = 20 --This is how long it will wait till it tries 2 spawn another farm
  17. }
  18.  
  19. local diff = _G.settings.Difficulty
  20. local name = _G.settings.AttackName
  21. local perSec = _G.settings.SpawnPer
  22. local perSec2 = _G.Upgrade_settings.UpgradePer
  23. local untiNum = _G.Upgrade_settings.WaitTillUnitNum
  24. local farm = _G.Fram_settings.FarmName
  25. local farmspawnper = _G.Fram_settings.SpawnPer
  26. local on = _G.Fram_settings.On
  27. if game.PlaceId == 3260590327 then
  28. repeat wait() until game:GetService("Workspace"):FindFirstChild("Elevators")
  29. for i,v in pairs(game:GetService("Workspace"):FindFirstChild("Elevators").Survival:GetChildren()) do
  30. if v:IsA("Model") then
  31. repeat wait() until game:GetService("ReplicatedStorage"):FindFirstChild("RemoteFunction")
  32. game:GetService("ReplicatedStorage"):FindFirstChild("RemoteFunction"):InvokeServer("Elevators", "Enter", {["Model"] = v})
  33. end
  34. end
  35. end
  36. if game.PlaceId ~= 3260590327 then
  37. repeat wait() until game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent")
  38. game:GetService("ReplicatedStorage").RemoteEvent:FireServer("Difficulty", "Vote", diff)
  39. end
  40. local spamSkip = coroutine.wrap(function()
  41. while wait() do
  42. game:GetService("ReplicatedStorage").RemoteEvent:FireServer("Vote", "Skip")
  43. end
  44. end)
  45. local attack = coroutine.wrap(function()
  46. while wait(perSec) do
  47. local meth = math.random(1,5)
  48. for i,v in pairs(game.workspace:FindFirstChild("Enemies"):GetChildren()) do
  49. if v:FindFirstChild("HumanoidRootPart") then
  50. repeat wait() until game:GetService("ReplicatedStorage"):FindFirstChild("RemoteFunction")
  51. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Towers", "Place", {["Rotation"] = CFrame.new(), ["Name"] = name, ["Position"] = v.HumanoidRootPart.Position + Vector3.new(meth,0,meth)})
  52. end
  53. end
  54. end
  55. end)
  56. local test = coroutine.wrap(function()
  57. while wait(0.5) do
  58. unit = 0
  59. for i,v in pairs(game:GetService("Workspace").Towers:GetChildren()) do
  60. if v:FindFirstChild("Owner") then
  61. if v.Owner.Value == game.Players.LocalPlayer then
  62. unit = unit+1
  63. end
  64. end
  65. end
  66. end
  67. end)
  68. local upgrade = coroutine.wrap(function()
  69. while wait(perSec2) do
  70. for i,v in pairs(game:GetService("Workspace").Towers:GetChildren()) do
  71. if v:FindFirstChild("Owner") then
  72. if v.Owner.Value == game.Players.LocalPlayer then
  73. if unit >= untiNum then
  74. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Towers", "Upgrade", "Set", {["Tower"] = v.Owner.Parent})
  75. end
  76. end
  77. end
  78. end
  79. end
  80. end)
  81. local farms = coroutine.wrap(function()
  82. while wait(farmspawnper) do
  83. if on then
  84. local methv2 = math.random(1,50)
  85. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Towers", "Place", {["Rotation"] = CFrame.new(), ["Name"] = farm, ["Position"] = Vector3.new(methv2,methv2,methv2)})
  86. end
  87. end
  88. end)
  89.  
  90. spamSkip()
  91. attack()
  92. upgrade()
  93. test()
  94. farms()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement