Advertisement
scripter99793

wizard tycoon 2 script

Apr 1st, 2021
5,581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.63 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local wizardHax = Instance.new("ScreenGui")
  7. local main = Instance.new("Frame")
  8. local title = Instance.new("TextLabel")
  9. local healthButton = Instance.new("TextButton")
  10. local funcButton = Instance.new("TextButton")
  11. local closeButton = Instance.new("TextButton")
  12. local healthGUI = Instance.new("Frame")
  13. local healthTitle = Instance.new("TextLabel")
  14. local targetBox = Instance.new("TextBox")
  15. local negateButton = Instance.new("TextButton")
  16. local numBox = Instance.new("TextBox")
  17. local errorTitle = Instance.new("TextLabel")
  18. local infoTarget = Instance.new("TextLabel")
  19. local infoNum = Instance.new("TextLabel")
  20. local addButton = Instance.new("TextButton")
  21. local setButton = Instance.new("TextButton")
  22. local closeButton_2 = Instance.new("TextButton")
  23. local funcGUI = Instance.new("Frame")
  24. local TextLabel = Instance.new("TextLabel")
  25. local closeButton_3 = Instance.new("TextButton")
  26. local funcButton1 = Instance.new("TextButton")
  27. local funcButton3 = Instance.new("TextButton")
  28. local funcButton6 = Instance.new("TextButton")
  29. local funcButton4 = Instance.new("TextButton")
  30. local funcButton9 = Instance.new("TextButton")
  31. local funcButton7 = Instance.new("TextButton")
  32. local funcButton2 = Instance.new("TextButton")
  33. local funcButton5 = Instance.new("TextButton")
  34. local funcButton8 = Instance.new("TextButton")
  35. local openButton = Instance.new("Frame")
  36. local openButton_2 = Instance.new("TextButton")
  37. local autoBuyStuff = false -- auto buy stuff in your team
  38. local autoGetMoney = false -- auto get money
  39. local players = game.Players
  40. local LocalPlayer = players.LocalPlayer
  41.  
  42. --Properties:
  43.  
  44. wizardHax.Name = "wizardHax"
  45. wizardHax.Parent = game.CoreGui
  46. wizardHax.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  47.  
  48. main.Name = "main"
  49. main.Parent = wizardHax
  50. main.BackgroundColor3 = Color3.fromRGB(85, 255, 127)
  51. main.BorderColor3 = Color3.fromRGB(170, 170, 255)
  52. main.BorderSizePixel = 3
  53. main.Position = UDim2.new(0.37714687, 0, 0.535626471, 0)
  54. main.Size = UDim2.new(0, 347, 0, 163)
  55. main.Visible = false
  56. main.Draggable = true
  57. main.Active = true
  58.  
  59. title.Name = "title"
  60. title.Parent = main
  61. title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  62. title.BackgroundTransparency = 1.000
  63. title.BorderSizePixel = 0
  64. title.Position = UDim2.new(0.239193082, 0, 0.0552147254, 0)
  65. title.Size = UDim2.new(0, 180, 0, 45)
  66. title.Font = Enum.Font.Fantasy
  67. title.Text = "wizardHaxs"
  68. title.TextColor3 = Color3.fromRGB(0, 100, 147)
  69. title.TextScaled = true
  70. title.TextSize = 14.000
  71. title.TextWrapped = true
  72.  
  73. funcButton.Name = "funcButton"
  74. funcButton.Parent = main
  75. funcButton.BackgroundColor3 = Color3.fromRGB(255, 219, 11)
  76. funcButton.BorderColor3 = Color3.fromRGB(0, 170, 255)
  77. funcButton.Position = UDim2.new(0.570605218, 0, 0.589695692, 0)
  78. funcButton.Size = UDim2.new(0, 130, 0, 41)
  79. funcButton.Font = Enum.Font.SourceSans
  80. funcButton.Text = "Functions"
  81. funcButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  82. funcButton.TextSize = 14.000
  83. funcButton.MouseButton1Down:Connect(function()
  84. funcGUI.Visible = not funcGUI.Visible
  85. end)
  86.  
  87. closeButton.Name = "closeButton"
  88. closeButton.Parent = main
  89. closeButton.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
  90. closeButton.BorderColor3 = Color3.fromRGB(0, 255, 127)
  91. closeButton.Position = UDim2.new(0.864185095, 0, 0.023779586, 0)
  92. closeButton.Size = UDim2.new(0, 41, 0, 41)
  93. closeButton.Font = Enum.Font.SourceSans
  94. closeButton.Text = "X"
  95. closeButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  96. closeButton.TextScaled = true
  97. closeButton.TextSize = 14.000
  98. closeButton.TextWrapped = true
  99. closeButton.MouseButton1Down:Connect(function()
  100. main.Visible = not main.Visible
  101. openButton.Visible = not openButton.Visible
  102. end)
  103.  
  104. funcGUI.Name = "funcGUI"
  105. funcGUI.Parent = wizardHax
  106. funcGUI.BackgroundColor3 = Color3.fromRGB(255, 180, 28)
  107. funcGUI.Position = UDim2.new(0.0849672928, 0, 0.583538115, 0)
  108. funcGUI.Size = UDim2.new(0, 291, 0, 187)
  109. funcGUI.Visible = false
  110. funcGUI.Draggable = true
  111. funcGUI.Active = true
  112.  
  113. TextLabel.Parent = funcGUI
  114. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 180, 28)
  115. TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  116. TextLabel.Size = UDim2.new(0, 64, 0, 33)
  117. TextLabel.Font = Enum.Font.SourceSans
  118. TextLabel.Text = "Functions"
  119. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  120. TextLabel.TextSize = 14.000
  121.  
  122. closeButton_3.Name = "closeButton"
  123. closeButton_3.Parent = funcGUI
  124. closeButton_3.BackgroundColor3 = Color3.fromRGB(255, 180, 28)
  125. closeButton_3.BorderColor3 = Color3.fromRGB(255, 180, 28)
  126. closeButton_3.Position = UDim2.new(0.854735434, 0, 0.0352619998, 0)
  127. closeButton_3.Size = UDim2.new(0, 35, 0, 35)
  128. closeButton_3.Font = Enum.Font.SourceSans
  129. closeButton_3.Text = "X"
  130. closeButton_3.TextColor3 = Color3.fromRGB(0, 0, 0)
  131. closeButton_3.TextScaled = true
  132. closeButton_3.TextSize = 14.000
  133. closeButton_3.TextWrapped = true
  134. closeButton_3.MouseButton1Down:Connect(function()
  135. funcGUI.Visible = not funcGUI.Visible
  136. end)
  137.  
  138. funcButton1.Name = "funcButton1"
  139. funcButton1.Parent = funcGUI
  140. funcButton1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  141. funcButton1.Position = UDim2.new(0.0721649453, 0, 0.272727281, 0)
  142. funcButton1.Size = UDim2.new(0, 82, 0, 32)
  143. funcButton1.Font = Enum.Font.SourceSans
  144. funcButton1.Text = "Auto Get Money"
  145. funcButton1.TextColor3 = Color3.fromRGB(0, 0, 0)
  146. funcButton1.TextSize = 14.000
  147. funcButton1.MouseButton1Down:Connect(function()
  148. autoGetMoney = not autoGetMoney
  149. end)
  150.  
  151. funcButton2.Name = "funcButton2"
  152. funcButton2.Parent = funcGUI
  153. funcButton2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  154. funcButton2.Position = UDim2.new(0.367697597, 0, 0.272727281, 0)
  155. funcButton2.Size = UDim2.new(0, 76, 0, 32)
  156. funcButton2.Font = Enum.Font.SourceSans
  157. funcButton2.Text = "Auto Buy Stuff"
  158. funcButton2.TextColor3 = Color3.fromRGB(0, 0, 0)
  159. funcButton2.TextSize = 14.000
  160. funcButton2.MouseButton1Down:Connect(function()
  161. autoBuyStuff = not autoBuyStuff
  162. end)
  163.  
  164. openButton.Name = "openButton"
  165. openButton.Parent = wizardHax
  166. openButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  167. openButton.Position = UDim2.new(0.883169949, 0, 0.534398019, 0)
  168. openButton.Size = UDim2.new(0, 125, 0, 63)
  169. openButton.Draggable = true
  170. openButton.Active = true
  171.  
  172. openButton_2.Name = "openButton"
  173. openButton_2.Parent = openButton
  174. openButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  175. openButton_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  176. openButton_2.Position = UDim2.new(0.0795714334, 0, 0.158888876, 0)
  177. openButton_2.Size = UDim2.new(0, 105, 0, 41)
  178. openButton_2.Font = Enum.Font.SourceSans
  179. openButton_2.Text = "Open"
  180. openButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  181. openButton_2.TextScaled = true
  182. openButton_2.TextSize = 14.000
  183. openButton_2.TextWrapped = true
  184. openButton_2.MouseButton1Down:Connect(function()
  185. main.Visible = not main.Visible
  186. openButton.Visible = not openButton.Visible
  187. end)
  188.  
  189. -- functions
  190.  
  191. spawn(function()
  192. local players = game.Players
  193. local localplayer = players.LocalPlayer
  194. local team = localplayer.Team.Name
  195. local kit = game.Workspace:FindFirstChild("berezaa's Tycoon Kit")
  196. if not kit then
  197. return
  198. end
  199. local RedTeam
  200. local RedSecond
  201. local owner
  202. local Essentials
  203. local buttons
  204. local player
  205. local giver
  206. while not RedTeam do
  207. if team ~= "For Hire" then
  208. if team == "Blue" then
  209. RedTeam = kit:FindFirstChild("Pastel "..team)
  210. elseif team == "Yellow" then
  211. RedTeam = kit:FindFirstChild("Cool "..team:lower())
  212. else
  213. RedTeam = kit:FindFirstChild("Medium "..team:lower())
  214. end
  215. end
  216. wait(1)
  217. team = localplayer.Team.Name
  218. end
  219. if RedTeam[team.."First"].Gate.Head.Decal.Texture == 'http://www.roblox.com/Thumbs/Avatar.ashx?username='..localplayer.Name then
  220. RedSecond = RedTeam[team.."First"]
  221. owner = true
  222. else
  223. RedSecond = RedTeam[team.."Second"]
  224. end
  225. Essentials = RedTeam.Essentials
  226. buttons = RedSecond.Buttons:GetChildren()
  227. player = game.Players.LocalPlayer
  228. if owner then
  229. giver = Essentials.Giver
  230. else
  231. giver = Essentials.Giver2
  232. end
  233. -- auto buy stuff (it sucks it just tps everything to you and if you have enough money to buy it you buy it)
  234. spawn(function()
  235. while wait(1) do
  236. if autoBuyStuff then
  237. local character = player.Character
  238. for i,button in pairs(buttons) do
  239. local head = button:FindFirstChild("Head")
  240. if head and character and character:FindFirstChild("HumanoidRootPart") then
  241. local orginalTransparency = head.Transparency
  242. if orginalTransparency ~= 1 then
  243. local originalpos = head.CFrame
  244. head.CanCollide = false
  245. head.Transparency = 1
  246. head.CFrame = character.HumanoidRootPart.CFrame
  247. wait(0.01)
  248. head.CFrame = originalpos
  249. head.Transparency = orginalTransparency
  250. end
  251. end
  252. end
  253. end
  254. end
  255. end)
  256. -- tp the collect money pad to you
  257. spawn(function()
  258. while wait(1) do
  259. if autoGetMoney then
  260. local character = player.Character
  261. if character and character:FindFirstChild("HumanoidRootPart") then
  262. local originalpos = giver.CFrame
  263. giver.CanCollide = false
  264. giver.Transparency = 1
  265. giver.CFrame = character.HumanoidRootPart.CFrame
  266. wait(0.025)
  267. giver.CFrame = originalpos
  268. giver.Transparency = 0
  269. giver.CanCollide = true
  270. end
  271. end
  272. end
  273. end)
  274. end)
  275. function shootWand(x,y,z,damage)
  276. local character = LocalPlayer.Character
  277. if character then
  278. local wand = character:FindFirstChild("Wand")
  279. if not wand then
  280. wand = LocalPlayer.Backpack:FindFirstChild("Wand")
  281. if wand then
  282. LocalPlayer.Character.Humanoid:EquipTool(wand)
  283. wait(0.05)
  284. wand = character:FindFirstChild("Wand")
  285. spawn(function()
  286. wait(0.1)
  287. LocalPlayer.Character.Humanoid:UnequipTools(wand)
  288. end)
  289. else
  290. return
  291. end
  292. end
  293. if not wand then
  294. return
  295. end
  296. local tbl_main =
  297. {
  298. CFrame.new(x, y, z),
  299. 0,
  300. 0.1,
  301. wand,
  302. damage,
  303. character
  304. }
  305. wand.Fire:FireServer(unpack(tbl_main))
  306. wait(0.01)
  307. end
  308. end
  309. function shootPlayer(_player,damage)
  310. local character = LocalPlayer.Character
  311. if character then
  312. local wand = character:FindFirstChild("Wand")
  313. local pos = _player.Character.HumanoidRootPart.CFrame
  314. local vel = _player.Character.HumanoidRootPart.Velocity
  315. if not wand then
  316. wand = LocalPlayer.Backpack:FindFirstChild("Wand")
  317. if wand then
  318. LocalPlayer.Character.Humanoid:EquipTool(wand)
  319. wait(0.05)
  320. wand = character:FindFirstChild("Wand")
  321. spawn(function()
  322. wait(0.1)
  323. LocalPlayer.Character.Humanoid:UnequipTools(wand)
  324. end)
  325. else
  326. return
  327. end
  328. if not wand then
  329. return
  330. end
  331. end
  332. local tbl_main =
  333. {
  334. CFrame.new(pos.x+vel.x/5,pos.y+vel.y/5,pos.z+vel.z/5),
  335. 0,
  336. 0.1,
  337. wand,
  338. damage,
  339. character
  340. }
  341. wand.Fire:FireServer(unpack(tbl_main))
  342. wait(0.01)
  343. end
  344. end
  345. function getSelector(text)
  346. local selectors = {}
  347. for i,selector in pairs(string.split(text,",")) do
  348. if selector == "all" then
  349. for i,player in pairs(players:GetChildren()) do
  350. if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  351. selectors[table.getn(selectors)+1] = player
  352. end
  353. end
  354. else
  355. for i,player in pairs(players:GetChildren()) do
  356. if startsWith(player.Name,selector) and player.Name ~= LocalPlayer.Name and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  357. selectors[table.getn(selectors)+1] = player
  358. end
  359. end
  360. end
  361. end
  362. return selectors
  363. end
  364. function startsWith(text1,text2)
  365. if string.lower(string.sub(text1,1,#text2)) == string.lower(text2) then
  366. return true
  367. end
  368. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement