Advertisement
Laau

[LUA] Tower Battles Script

Oct 15th, 2017
35,535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. -- made by Lau
  2. -- script by Deidara
  3.  
  4. local ScreenGui = Instance.new("ScreenGui")
  5. local Frame = Instance.new("Frame")
  6. local player = Instance.new("TextBox")
  7. local upgrade = Instance.new("TextButton")
  8. ScreenGui.Parent = game.CoreGui
  9. Frame.Parent = ScreenGui
  10. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  11. Frame.BackgroundTransparency = 0.5
  12. Frame.BorderSizePixel = 3
  13. Frame.Active = true
  14. Frame.Draggable = true
  15. Frame.Position = UDim2.new(0.411496341, 0, 0.318352073, 0)
  16. Frame.Size = UDim2.new(0, 200, 0, 201)
  17.  
  18. player.Name = "player"
  19. player.Parent = Frame
  20. player.BackgroundColor3 = Color3.new(1, 1, 1)
  21. player.BackgroundTransparency = 0.5
  22. player.BorderSizePixel = 0
  23. player.Position = UDim2.new(0.247500002, 0, 0.482587039, 0)
  24. player.Size = UDim2.new(0, 102, 0, 40)
  25. player.Font = Enum.Font.Cartoon
  26. player.FontSize = Enum.FontSize.Size14
  27. player.Text = "Player Name"
  28. player.TextSize = 14
  29.  
  30. upgrade.Name = "upgrade"
  31. upgrade.Parent = Frame
  32. upgrade.BackgroundColor3 = Color3.new(1, 1, 1)
  33. upgrade.BackgroundTransparency = 0.5
  34. upgrade.BorderSizePixel = 0
  35. upgrade.Position = UDim2.new(0.200000003, 0, 0.149253726, 0)
  36. upgrade.Size = UDim2.new(0, 121, 0, 47)
  37. upgrade.Font = Enum.Font.Cartoon
  38. upgrade.FontSize = Enum.FontSize.Size14
  39. upgrade.Text = "Upgrade Towers"
  40. upgrade.TextSize = 14
  41.  
  42. upgrade.MouseButton1Down:connect(function()
  43. local ws = workspace
  44. local plr = game:GetService('Players')[player.Text]
  45. for i,v in pairs(ws.Towers:GetChildren()) do
  46. if v.Owner.Value == plr and v.Tower.UP1.Value < 4 then
  47. repeat
  48. workspace.HasEnough:InvokeServer('Cash',0)
  49. workspace.Spend:InvokeServer(0)
  50. workspace.UpgradeTower:InvokeServer(v.Name,0)
  51. until v.Tower.UP1.Value >= 4
  52. end
  53. end
  54. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement