AtomicBear011

TOWER DEFENSE MONEY

Jun 26th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. _G.Enable = true
  2. while _G.Enable and wait() do
  3. function damage()
  4. for i, v in pairs(workspace.Towers:GetChildren()) do
  5. if
  6. v.Type.Value ~= "Farm" and v.Type.Value ~= "Pursuit" and v.Type.Value ~= "Commando" and
  7. v.Type.Value ~= "Paintballer" and
  8. v.Type.Value ~= "Rocketeer" and
  9. v.Type.Value ~= "Mortar" and
  10. v.Type.Value ~= "DJ Booth" and
  11. v.Type.Value ~= "Demoman" and
  12. v.Type.Value ~= "Military Base"
  13. then
  14. if v.HumanoidRootPart:FindFirstChild("BillboardGui") ~= nil then
  15. v.HumanoidRootPart:FindFirstChild("BillboardGui").TextLabel.Text = tostring(v.TotalDamage.Value)
  16. else -- Happens if there is no BillboardGui
  17. local BillboardGui = Instance.new("BillboardGui", v.HumanoidRootPart)
  18. BillboardGui.Size = UDim2.new(0, 100, 0, 40)
  19. BillboardGui.StudsOffset = Vector3.new(0, 2, 0)
  20. BillboardGui.Adornee = v.HumanoidRootPart
  21. local TextLabel = Instance.new("TextLabel")
  22. TextLabel.Parent = BillboardGui
  23. TextLabel.BackgroundTransparency = 1
  24. TextLabel.BorderSizePixel = 0
  25. TextLabel.Text = tostring(v.TotalDamage.Value)
  26. TextLabel.Font = "ArialBold"
  27. TextLabel.FontSize = "Size14"
  28. TextLabel.TextStrokeTransparency = 0
  29. TextLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
  30. TextLabel.TextColor3 = Color3.new(255, 255, 255)
  31. TextLabel.Size = UDim2.new(1, 0, 0.5, 0)
  32. end -- lines 6-23
  33. elseif v.Type.Value == "Pursuit" or v.Type.Value == "Commando" then
  34. if v.HumanoidRootPart.Ring:FindFirstChild("BillboardGui") ~= nil then
  35. v.HumanoidRootPart.Ring:FindFirstChild("BillboardGui").TextLabel.Text =
  36. tostring(v.TotalDamage.Value)
  37. else -- Happens if there is no BillboardGui
  38. local BillboardGui = Instance.new("BillboardGui", v.HumanoidRootPart.Ring)
  39. BillboardGui.Size = UDim2.new(0, 100, 0, 40)
  40. BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
  41. BillboardGui.Adornee = v.HumanoidRootPart.Ring
  42. local TextLabel = Instance.new("TextLabel")
  43. TextLabel.Parent = BillboardGui
  44. TextLabel.BackgroundTransparency = 1
  45. TextLabel.BorderSizePixel = 0
  46. TextLabel.Text = tostring(v.TotalDamage.Value)
  47. TextLabel.Font = "ArialBold"
  48. TextLabel.FontSize = "Size14"
  49. TextLabel.TextStrokeTransparency = 0
  50. TextLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
  51. TextLabel.TextColor3 = Color3.new(255, 255, 255)
  52. TextLabel.Size = UDim2.new(1, 0, 0.5, 0)
  53. end -- lines 26-43
  54. end
  55. end
  56. end
  57. pcall(damage)
  58. end
Add Comment
Please, Sign In to add comment