From venuslock, 8 Months ago, written in Lua.
Embed
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9. local AreaInput = Instance.new("TextBox")
  10. local TextLabel_2 = Instance.new("TextLabel")
  11. local attackStatus = Instance.new("TextButton")
  12. local TextLabel_3 = Instance.new("TextLabel")
  13. local farmStatus = Instance.new("TextButton")
  14. local TextLabel_4 = Instance.new("TextLabel")
  15. local TextLabel_5 = Instance.new("TextLabel")
  16.  
  17. --Properties:
  18.  
  19. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  20. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  21.  
  22. Frame.Parent = ScreenGui
  23. Frame.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  24. Frame.Position = UDim2.new(0.17331022, 0, 0.411547899, 0)
  25. Frame.Size = UDim2.new(0.29731369, 0, 0.221253082, 0)
  26.  
  27. TextLabel.Parent = Frame
  28. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  29. TextLabel.BackgroundTransparency = 1.000
  30. TextLabel.Position = UDim2.new(0, 0, 0.889999986, 0)
  31. TextLabel.Size = UDim2.new(1, 0, 0.100499533, 0)
  32. TextLabel.Font = Enum.Font.SourceSans
  33. TextLabel.Text = "My Dragon Tycoon Script Made by ISReFleX"
  34. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  35. TextLabel.TextScaled = true
  36. TextLabel.TextSize = 14.000
  37. TextLabel.TextWrapped = true
  38.  
  39. AreaInput.Name = "AreaInput"
  40. AreaInput.Parent = Frame
  41. AreaInput.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
  42. AreaInput.BorderSizePixel = 0
  43. AreaInput.Position = UDim2.new(0.324000001, 0, 0.0900000036, 0)
  44. AreaInput.Size = UDim2.new(0.350699544, 0, 0.100000001, 0)
  45. AreaInput.Font = Enum.Font.SourceSans
  46. AreaInput.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  47. AreaInput.PlaceholderText = "Select area (1-9)"
  48. AreaInput.Text = ""
  49. AreaInput.TextColor3 = Color3.fromRGB(0, 0, 0)
  50. AreaInput.TextSize = 14.000
  51.  
  52. TextLabel_2.Parent = Frame
  53. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  54. TextLabel_2.BackgroundTransparency = 1.000
  55. TextLabel_2.Position = UDim2.new(0, 0, 0.0904441997, 0)
  56. TextLabel_2.Size = UDim2.new(0.323520839, 0, 0.0983953252, 0)
  57. TextLabel_2.Font = Enum.Font.SourceSansBold
  58. TextLabel_2.Text = "AUTO ATTACK:"
  59. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  60. TextLabel_2.TextScaled = true
  61. TextLabel_2.TextSize = 14.000
  62. TextLabel_2.TextWrapped = true
  63.  
  64. attackStatus.Name = "attackStatus"
  65. attackStatus.Parent = Frame
  66. attackStatus.BackgroundColor3 = Color3.fromRGB(26, 107, 22)
  67. attackStatus.BorderSizePixel = 0
  68. attackStatus.Position = UDim2.new(0.720000029, 0, 0.0900000036, 0)
  69. attackStatus.Size = UDim2.new(0.200000003, 0, 0.100000001, 0)
  70. attackStatus.Font = Enum.Font.SourceSansBold
  71. attackStatus.Text = "START!"
  72. attackStatus.TextColor3 = Color3.fromRGB(255, 255, 255)
  73. attackStatus.TextSize = 14.000
  74.  
  75. TextLabel_3.Parent = Frame
  76. TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77. TextLabel_3.BackgroundTransparency = 1.000
  78. TextLabel_3.Position = UDim2.new(0, 0, 0.345857859, 0)
  79. TextLabel_3.Size = UDim2.new(0.323520839, 0, 0.0983953252, 0)
  80. TextLabel_3.Font = Enum.Font.SourceSansBold
  81. TextLabel_3.Text = "AUTO FARM:"
  82. TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
  83. TextLabel_3.TextScaled = true
  84. TextLabel_3.TextSize = 14.000
  85. TextLabel_3.TextWrapped = true
  86.  
  87. farmStatus.Name = "farmStatus"
  88. farmStatus.Parent = Frame
  89. farmStatus.BackgroundColor3 = Color3.fromRGB(26, 107, 22)
  90. farmStatus.BorderSizePixel = 0
  91. farmStatus.Position = UDim2.new(0.320699543, 0, 0.345413655, 0)
  92. farmStatus.Size = UDim2.new(0.200000003, 0, 0.100000001, 0)
  93. farmStatus.Font = Enum.Font.SourceSansBold
  94. farmStatus.Text = "START!"
  95. farmStatus.TextColor3 = Color3.fromRGB(255, 255, 255)
  96. farmStatus.TextSize = 14.000
  97.  
  98. TextLabel_4.Parent = Frame
  99. TextLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  100. TextLabel_4.BackgroundTransparency = 1.000
  101. TextLabel_4.Position = UDim2.new(-0, 0, 0.44600001, 0)
  102. TextLabel_4.Size = UDim2.new(1, 0, 0.0799999982, 0)
  103. TextLabel_4.Font = Enum.Font.SourceSans
  104. TextLabel_4.Text = "Autofarm will only work later on in the game when you own farms."
  105. TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
  106. TextLabel_4.TextScaled = true
  107. TextLabel_4.TextSize = 14.000
  108. TextLabel_4.TextWrapped = true
  109.  
  110. TextLabel_5.Parent = Frame
  111. TextLabel_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  112. TextLabel_5.BackgroundTransparency = 1.000
  113. TextLabel_5.Position = UDim2.new(-0.00291460217, 0, 0.718070984, 0)
  114. TextLabel_5.Size = UDim2.new(1, 0, 0.124419786, 0)
  115. TextLabel_5.Font = Enum.Font.SourceSansBold
  116. TextLabel_5.Text = "SELECT A TYCOON BEFORE STARTING!"
  117. TextLabel_5.TextColor3 = Color3.fromRGB(255, 255, 255)
  118. TextLabel_5.TextScaled = true
  119. TextLabel_5.TextSize = 14.000
  120. TextLabel_5.TextWrapped = true
  121.  
  122.  
  123.  
  124.  
  125. ---- ACTUAL CODE
  126.  
  127.  
  128.  
  129.  
  130. local mainStuff = Frame
  131. local areaInput = AreaInput
  132.  
  133.  
  134. local player = game.Players.LocalPlayer
  135. _G.AutoAttack = false
  136. _G.AutoFarm = false
  137.  
  138.  
  139. function autoAttack()
  140.         spawn(function()
  141.                 while _G.AutoAttack == true do
  142.                         wait()
  143.                         local spawnList = game.Workspace.Monster.Area[areaInput.Text]:GetChildren()
  144.                         for i,v in pairs (spawnList)do
  145.                                 if _G.AutoAttack == true and v.Name == "Spawn" then    
  146.                                         local mob = v:FindFirstChildWhichIsA("Model")
  147.                                         if mob then
  148.                                                 player.Character:SetPrimaryPartCFrame(mob:FindFirstChild("HumanoidRootPart").CFrame)
  149.                                                 repeat
  150.                                                         if not player.Character:FindFirstChild("Tool") then
  151.                                                                 player.Character.Humanoid:EquipTool(player.Backpack.Tool)
  152.                                                         end
  153.                                                         player.Character.Tool:Activate()
  154.                                                         wait(0.5)
  155.                                                 until mob.Configuration.isDead.Value or _G.AutoAttack == false
  156.                                         end
  157.                                 end
  158.                         end
  159.                 end
  160.         end)
  161. end
  162.  
  163.  
  164. function autoFarm()
  165.         spawn(function()
  166.                 game.Players.LocalPlayer.PlayerGui.Core.Telescope.TelescopeLocal.Disabled = true
  167.                 while _G.AutoFarm == true  do
  168.                         wait(1)
  169.                         for i,v in pairs(game:GetService("Workspace").MyDragonTycoon.Tycoons[player.Team.Name]:GetDescendants()) do
  170.                                 if v:IsA("ClickDetector") then
  171.                                         fireclickdetector(v)
  172.                                 end
  173.                         end
  174.                 end
  175.         end)
  176. end
  177.  
  178.  
  179. local VirtualUser=game:GetService('VirtualUser')
  180. game:GetService'Players'.LocalPlayer.Idled:Connect(function()
  181.         VirtualUser:CaptureController()
  182.         VirtualUser:ClickButton2(Vector2.new())
  183. end)
  184.  
  185.  
  186.  
  187. local UserInputService = game:GetService("UserInputService")
  188.  
  189. local gui = mainStuff
  190.  
  191. local dragging
  192. local dragInput
  193. local dragStart
  194. local startPos
  195.  
  196. local function update(input)
  197.         local delta = input.Position - dragStart
  198.         gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  199. end
  200.  
  201. gui.InputBegan:Connect(function(input)
  202.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  203.                 dragging = true
  204.                 dragStart = input.Position
  205.                 startPos = gui.Position
  206.  
  207.                 input.Changed:Connect(function()
  208.                         if input.UserInputState == Enum.UserInputState.End then
  209.                                 dragging = false
  210.                         end
  211.                 end)
  212.         end
  213. end)
  214.  
  215. gui.InputChanged:Connect(function(input)
  216.         if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  217.                 dragInput = input
  218.         end
  219. end)
  220.  
  221. UserInputService.InputChanged:Connect(function(input)
  222.         if input == dragInput and dragging then
  223.                 update(input)
  224.         end
  225. end)
  226.  
  227.  
  228.  
  229. attackStatus.MouseButton1Click:Connect(function()
  230.         if not _G.AutoAttack then
  231.                 if tonumber(areaInput.Text) then
  232.                         _G.AutoAttack = true
  233.                         autoAttack()
  234.                         attackStatus.BackgroundColor3 = Color3.fromRGB(107,0,2)
  235.                         attackStatus.Text = "STOP!"
  236.                 else
  237.                         areaInput.Text = "Pick an area (1-9)!"
  238.                 end
  239.         else
  240.                 _G.AutoAttack = false
  241.                 attackStatus.BackgroundColor3 = Color3.fromRGB(26,107,22)
  242.                 attackStatus.Text = "START!"
  243.  
  244.         end
  245. end)
  246.  
  247. farmStatus.MouseButton1Click:Connect(function()
  248.         if not _G.AutoFarm then
  249.                 _G.AutoFarm = true
  250.                 autoFarm()
  251.                 farmStatus.BackgroundColor3 = Color3.fromRGB(107,0,2)
  252.                 farmStatus.Text = "STOP!"
  253.         else
  254.                 _G.AutoFarm = false
  255.                 farmStatus.BackgroundColor3 = Color3.fromRGB(26,107,22)
  256.                 farmStatus.Text = "START!"
  257.         end
  258. end)
  259.