Advertisement
Honansik

Warrior Simulator GUI Script

Dec 7th, 2021
2,480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.57 KB | None | 0 0
  1. -- Instances:
  2.  
  3. local sautosfvarm = Instance.new("ScreenGui")
  4. local main = Instance.new("Frame")
  5. local TextLabel = Instance.new("TextLabel")
  6. local options = Instance.new("ScrollingFrame")
  7. local grassland = Instance.new("TextButton")
  8. local egypt = Instance.new("TextButton")
  9. local future = Instance.new("TextButton")
  10. local moon = Instance.new("TextButton")
  11. local overseer = Instance.new("TextButton")
  12. local lavaland = Instance.new("TextButton")
  13. local desert = Instance.new("TextButton")
  14. local iceland = Instance.new("TextButton")
  15. local mars = Instance.new("TextButton")
  16. local toggle = Instance.new("TextButton")
  17. local exit = Instance.new("TextButton")
  18. local coins = Instance.new("TextButton")
  19.  
  20. --Properties:
  21.  
  22. sautosfvarm.Name = "sautosfvarm"
  23. sautosfvarm.Parent = game.CoreGui
  24. sautosfvarm.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  25.  
  26. main.Name = "main"
  27. main.Parent = sautosfvarm
  28. main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  29. main.Position = UDim2.new(0.0611183383, 0, 0.373848975, 0)
  30. main.Size = UDim2.new(0, 225, 0, 288)
  31.  
  32. TextLabel.Parent = main
  33. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  34. TextLabel.Position = UDim2.new(0.0533333346, 0, 0.027777778, 0)
  35. TextLabel.Size = UDim2.new(0, 152, 0, 28)
  36. TextLabel.Font = Enum.Font.SourceSans
  37. TextLabel.Text = "my firsrt sautosfvarm"
  38. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  39. TextLabel.TextSize = 14.000
  40.  
  41. options.Name = "options"
  42. options.Parent = main
  43. options.Active = true
  44. options.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  45. options.Position = UDim2.new(0.0444444455, 0, 0.149305552, 0)
  46. options.Size = UDim2.new(0, 202, 0, 151)
  47.  
  48. grassland.Name = "grassland"
  49. grassland.Parent = options
  50. grassland.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. grassland.Position = UDim2.new(0.0594059415, 0, 0.0206135698, 0)
  52. grassland.Size = UDim2.new(0, 163, 0, 24)
  53. grassland.Font = Enum.Font.SourceSans
  54. grassland.Text = "grassland"
  55. grassland.TextColor3 = Color3.fromRGB(0, 0, 0)
  56. grassland.TextSize = 14.000
  57.  
  58. egypt.Name = "egypt"
  59. egypt.Parent = options
  60. egypt.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  61. egypt.Position = UDim2.new(0.0594059415, 0, 0.0779052451, 0)
  62. egypt.Size = UDim2.new(0, 163, 0, 24)
  63. egypt.Font = Enum.Font.SourceSans
  64. egypt.Text = "egypt"
  65. egypt.TextColor3 = Color3.fromRGB(0, 0, 0)
  66. egypt.TextSize = 14.000
  67.  
  68. future.Name = "future"
  69. future.Parent = options
  70. future.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  71. future.Position = UDim2.new(0.0594059415, 0, 0.135196909, 0)
  72. future.Size = UDim2.new(0, 163, 0, 24)
  73. future.Font = Enum.Font.SourceSans
  74. future.Text = "future"
  75. future.TextColor3 = Color3.fromRGB(0, 0, 0)
  76. future.TextSize = 14.000
  77.  
  78. moon.Name = "moon"
  79. moon.Parent = options
  80. moon.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  81. moon.Position = UDim2.new(0.0594059415, 0, 0.199433029, 0)
  82. moon.Size = UDim2.new(0, 163, 0, 24)
  83. moon.Font = Enum.Font.SourceSans
  84. moon.Text = "moon"
  85. moon.TextColor3 = Color3.fromRGB(0, 0, 0)
  86. moon.TextSize = 14.000
  87.  
  88. overseer.Name = "overseer"
  89. overseer.Parent = options
  90. overseer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  91. overseer.Position = UDim2.new(0.0594059415, 0, 0.263669133, 0)
  92. overseer.Size = UDim2.new(0, 163, 0, 24)
  93. overseer.Font = Enum.Font.SourceSans
  94. overseer.Text = "overseer"
  95. overseer.TextColor3 = Color3.fromRGB(0, 0, 0)
  96. overseer.TextSize = 14.000
  97.  
  98. lavaland.Name = "lavaland"
  99. lavaland.Parent = options
  100. lavaland.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  101. lavaland.Position = UDim2.new(0.0594059415, 0, 0.331377476, 0)
  102. lavaland.Size = UDim2.new(0, 163, 0, 24)
  103. lavaland.Font = Enum.Font.SourceSans
  104. lavaland.Text = "lavaland"
  105. lavaland.TextColor3 = Color3.fromRGB(0, 0, 0)
  106. lavaland.TextSize = 14.000
  107.  
  108. desert.Name = "desert"
  109. desert.Parent = options
  110. desert.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  111. desert.Position = UDim2.new(0.0594059415, 0, 0.397349715, 0)
  112. desert.Size = UDim2.new(0, 163, 0, 24)
  113. desert.Font = Enum.Font.SourceSans
  114. desert.Text = "desert"
  115. desert.TextColor3 = Color3.fromRGB(0, 0, 0)
  116. desert.TextSize = 14.000
  117.  
  118. iceland.Name = "iceland"
  119. iceland.Parent = options
  120. iceland.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  121. iceland.Position = UDim2.new(0.0594059415, 0, 0.46158582, 0)
  122. iceland.Size = UDim2.new(0, 163, 0, 24)
  123. iceland.Font = Enum.Font.SourceSans
  124. iceland.Text = "iceland"
  125. iceland.TextColor3 = Color3.fromRGB(0, 0, 0)
  126. iceland.TextSize = 14.000
  127.  
  128. mars.Name = "mars"
  129. mars.Parent = options
  130. mars.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  131. mars.Position = UDim2.new(0.0594059415, 0, 0.52408582, 0)
  132. mars.Size = UDim2.new(0, 163, 0, 24)
  133. mars.Font = Enum.Font.SourceSans
  134. mars.Text = "mars"
  135. mars.TextColor3 = Color3.fromRGB(0, 0, 0)
  136. mars.TextSize = 14.000
  137.  
  138. toggle.Name = "toggle"
  139. toggle.Parent = main
  140. toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  141. toggle.Position = UDim2.new(0.0444444455, 0, 0.839838326, 0)
  142. toggle.Size = UDim2.new(0, 202, 0, 30)
  143. toggle.Font = Enum.Font.SourceSans
  144. toggle.Text = "toggle sautosfvarm"
  145. toggle.TextColor3 = Color3.fromRGB(0, 0, 0)
  146. toggle.TextSize = 14.000
  147.  
  148. exit.Name = "exit"
  149. exit.Parent = main
  150. exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  151. exit.Position = UDim2.new(0.822222233, 0, 0.027777778, 0)
  152. exit.Size = UDim2.new(0, 27, 0, 28)
  153. exit.Font = Enum.Font.SourceSans
  154. exit.Text = "X"
  155. exit.TextColor3 = Color3.fromRGB(0, 0, 0)
  156. exit.TextScaled = true
  157. exit.TextSize = 14.000
  158. exit.TextWrapped = true
  159.  
  160. coins.Name = "coins"
  161. coins.Parent = main
  162. coins.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  163. coins.Position = UDim2.new(0.0444444455, 0, 0.704421639, 0)
  164. coins.Size = UDim2.new(0, 202, 0, 30)
  165. coins.Font = Enum.Font.SourceSans
  166. coins.Text = "farm coins"
  167. coins.TextColor3 = Color3.fromRGB(0, 0, 0)
  168. coins.TextSize = 14.000
  169.  
  170. local lplr = game.Players.LocalPlayer
  171. local plr = lplr.Name
  172.  
  173.  
  174. local Toggle = false
  175. local farmOption = nil
  176. local enemieTarget = nil
  177. local farmZone = nil
  178. local attacking = false
  179.  
  180. grassland.MouseButton1Click:Connect(function()
  181.     farmOption = "Grassland"
  182. end)
  183.  
  184. egypt.MouseButton1Click:Connect(function()
  185.     farmOption = "Egypt"
  186. end)
  187.  
  188. future.MouseButton1Click:Connect(function()
  189.     farmOption = "Future"
  190. end)
  191.  
  192. moon.MouseButton1Click:Connect(function()
  193.     farmOption = "Moon"
  194. end)
  195.  
  196. overseer.MouseButton1Click:Connect(function()
  197.     farmOption = "Overseer"
  198. end)
  199.  
  200. lavaland.MouseButton1Click:Connect(function()
  201.     farmOption = "Lavaland"
  202. end)
  203.  
  204. desert.MouseButton1Click:Connect(function()
  205.     farmOption = "Desert"
  206. end)
  207.  
  208. iceland.MouseButton1Click:Connect(function()
  209.     farmOption = "Iceland"
  210. end)
  211.  
  212. mars.MouseButton1Click:Connect(function()
  213.     farmOption = "Mars"
  214. end)
  215.  
  216. toggle.MouseButton1Click:Connect(function()
  217.     Toggle = not Toggle
  218. end)
  219.  
  220. coins.MouseButton1Click:Connect(function()
  221.     farmZone = game.Workspace.newMap.Zones[farmOption]
  222.  
  223.     for i,v in pairs(farmZone.CoinStorage:GetChildren()) do
  224.         lplr.Character.HumanoidRootPart.CFrame = v.Detector.CFrame
  225.         wait(.8)
  226.     end
  227. end)
  228.  
  229. exit.MouseButton1Click:Connect(function()
  230.     sautosfvarm:Destroy()
  231. end)    
  232.  
  233.  
  234. local function checkHealth(npc)
  235.     if npc.Humanoid.Health == 0 then
  236.         attacking = false
  237.     end  
  238. end  
  239.  
  240.  
  241. if game.Workspace[plr]:FindFirstChild("Basic Sword") then
  242.     enemieTarget = "Warrior"
  243.     farmOption = "Grassland"
  244. end
  245.  
  246. --[[
  247.  
  248. if lplr.Data.Backpack.Value == lplr.Data.Capacity.Value then
  249.     lplr.Character.HumanoidRootPart.CFrame = CFrame.new(-73.8923492, 4.82500696, 138.237549, -0.38339889, -1.59785678e-08, -0.923582852, 4.37895444e-08, 1, -3.54786067e-08, 0.923582852, -5.40457314e-08, -0.38339889)
  250. end
  251.        
  252. ]]
  253.  
  254. while wait() do
  255.     if Toggle == true then
  256.         if attacking then
  257.             return -- already attacking a npc
  258.         else
  259.             if farmOption ~= nil then
  260.                 farmZone = game.Workspace.newMap.Zones[farmOption]
  261.  
  262.                 for i,v in pairs(farmZone.Enemies:GetChildren()) do
  263.                     if enemieTarget ~= nil then
  264.                         if v.Name == enemieTarget then
  265.                             attacking = true
  266.                             lplr.Character.HumanoidRootPart.CFrame = v.HumanoidRootPart.CFrame
  267.                             mouse1click(MOUSE_CLICK)
  268.                             repeat wait() checkHealth(v) until attacking == false
  269.                         end  
  270.                     else
  271.                         attacking = true
  272.                         lplr.Character.HumanoidRootPart.CFrame = v.HumanoidRootPart.CFrame
  273.                         mouse1click(MOUSE_CLICK)
  274.                         repeat wait() checkHealth(v) mouse1click(MOUSE_CLICK) until attacking == false
  275.                     end    
  276.                 end    
  277.             end
  278.         end
  279.        
  280.         if attacking == false then
  281.             if lplr.Data.Backpack.Value == lplr.Data.Capacity.Value then
  282.                 lplr.Character.HumanoidRootPart.CFrame = CFrame.new(-73.8923492, 4.82500696, 138.237549, -0.38339889, -1.59785678e-08, -0.923582852, 4.37895444e-08, 1, -3.54786067e-08, 0.923582852, -5.40457314e-08, -0.38339889)
  283.             end
  284.         end
  285.     else
  286.        
  287.     end
  288.    
  289.    
  290. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement