Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.47 KB | None | 0 0
  1. _G.print = true
  2.  
  3. target = {}
  4. local HitPoints={
  5. ['GoldAxe']= 50;
  6. ['BasicHatchet']= 0.2;
  7. ['Axe1']= 0.55;
  8. ['Axe2']= 0.93;
  9. ['AxeAlphaTesters']= 1.5;
  10. ['Rukiryaxe']= 1.68;
  11. ['Axe3']= 1.45;
  12. ['AxeBetaTesters']= 1.45;
  13. ['FireAxe']= 0.6;
  14. ['SilverAxe']= 1.6;
  15. ['EndTimesAxe']= 10000000;
  16. ['AxeChicken']= 0.1;
  17. ['CandyCaneAxe']= 0;
  18. }
  19.  
  20. local dropoff = {
  21. CFrame.new(330, -0.296, 85.791), -- dropoff 1
  22. CFrame.new(315, -0.296, 85.791), -- dropoff 2
  23. }
  24. local TreeNames = {}
  25. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  26. if l.Name == "TreeRegion" then
  27. if l ~= nil then
  28. for i, b in pairs(l:GetChildren()) do
  29. if b:IsA("Model") then
  30. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Generic" then
  31. l.Name = "Generic"
  32. table.insert(TreeNames, l.Name)
  33. end
  34. end
  35. end
  36. end
  37. end
  38. end
  39. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  40. if l.Name == "TreeRegion" then
  41. if l ~= nil then
  42. for i, b in pairs(l:GetChildren()) do
  43. if b:IsA("Model") then
  44. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Elm" then
  45. l.Name = "Elm"
  46. table.insert(TreeNames, l.Name)
  47. end
  48. end
  49. end
  50. end
  51. end
  52. end
  53. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  54. if l.Name == "TreeRegion" then
  55. if l ~= nil then
  56. for i, b in pairs(l:GetChildren()) do
  57. if b:IsA("Model") then
  58. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Walnut" then
  59. l.Name = "Walnut"
  60. table.insert(TreeNames, l.Name)
  61. end
  62. end
  63. end
  64. end
  65. end
  66. end
  67. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  68. if l.Name == "TreeRegion" then
  69. if l ~= nil then
  70. for i, b in pairs(l:GetChildren()) do
  71. if b:IsA("Model") then
  72. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Cherry" then
  73. l.Name = "Cherry"
  74. table.insert(TreeNames, l.Name)
  75. end
  76. end
  77. end
  78. end
  79. end
  80. end
  81. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  82. if l.Name == "TreeRegion" then
  83. if l ~= nil then
  84. for i, b in pairs(l:GetChildren()) do
  85. if b:IsA("Model") then
  86. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "SnowGlow" then
  87. l.Name = "SnowGlow"
  88. table.insert(TreeNames, l.Name)
  89. end
  90. end
  91. end
  92. end
  93. end
  94. end
  95. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  96. if l.Name == "TreeRegion" then
  97. if l ~= nil then
  98. for i, b in pairs(l:GetChildren()) do
  99. if b:IsA("Model") then
  100. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Oak" then
  101. l.Name = "Oak"
  102. table.insert(TreeNames, l.Name)
  103. end
  104. end
  105. end
  106. end
  107. end
  108. end
  109. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  110. if l.Name == "TreeRegion" then
  111. if l ~= nil then
  112. for i, b in pairs(l:GetChildren()) do
  113. if b:IsA("Model") then
  114. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Birch" then
  115. l.Name = "Birch"
  116. table.insert(TreeNames, l.Name)
  117. end
  118. end
  119. end
  120. end
  121. end
  122. end
  123. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  124. if l.Name == "TreeRegion" then
  125. if l ~= nil then
  126. for i, b in pairs(l:GetChildren()) do
  127. if b:IsA("Model") then
  128. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Koa" then
  129. l.Name = "Koa"
  130. table.insert(TreeNames, l.Name)
  131. end
  132. end
  133. end
  134. end
  135. end
  136. end
  137. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  138. if l.Name == "TreeRegion" then
  139. if l ~= nil then
  140. for i, b in pairs(l:GetChildren()) do
  141. if b:IsA("Model") then
  142. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Cherry" then
  143. l.Name = "Fir"
  144. table.insert(TreeNames, l.Name)
  145. end
  146. end
  147. end
  148. end
  149. end
  150. end
  151. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  152. if l.Name == "TreeRegion" then
  153. if l ~= nil then
  154. for i, b in pairs(l:GetChildren()) do
  155. if b:IsA("Model") then
  156. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Pine" then
  157. l.Name = "Pine"
  158. table.insert(TreeNames, l.Name)
  159. end
  160. end
  161. end
  162. end
  163. end
  164. end
  165. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  166. if l.Name == "TreeRegion" then
  167. if l ~= nil then
  168. for i, b in pairs(l:GetChildren()) do
  169. if b:IsA("Model") then
  170. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Volcano" then
  171. l.Name = "Volcano"
  172. table.insert(TreeNames, l.Name)
  173. end
  174. end
  175. end
  176. end
  177. end
  178. end
  179. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  180. if l.Name == "TreeRegion" then
  181. if l ~= nil then
  182. for i, b in pairs(l:GetChildren()) do
  183. if b:IsA("Model") then
  184. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "GreenSwampy" then
  185. l.Name = "GreenSwampy"
  186. table.insert(TreeNames, l.Name)
  187. end
  188. end
  189. end
  190. end
  191. end
  192. end
  193. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  194. if l.Name == "TreeRegion" then
  195. if l ~= nil then
  196. for i, b in pairs(l:GetChildren()) do
  197. if b:IsA("Model") then
  198. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "CaveCrawler" then
  199. l.Name = "CaveCrawler"
  200. table.insert(TreeNames, l.Name)
  201. end
  202. end
  203. end
  204. end
  205. end
  206. end
  207. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  208. if l.Name == "TreeRegion" then
  209. if l ~= nil then
  210. for i, b in pairs(l:GetChildren()) do
  211. if b:IsA("Model") then
  212. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Palm" then
  213. l.Name = "Palm"
  214. table.insert(TreeNames, l.Name)
  215. end
  216. end
  217. end
  218. end
  219. end
  220. end
  221. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  222. if l.Name == "TreeRegion" then
  223. if l ~= nil then
  224. for i, b in pairs(l:GetChildren()) do
  225. if b:IsA("Model") then
  226. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Gold" then
  227. l.Name = "Gold"
  228. table.insert(TreeNames, l.Name)
  229. end
  230. end
  231. end
  232. end
  233. end
  234. end
  235. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  236. if l.Name == "TreeRegion" then
  237. if l ~= nil then
  238. for i, b in pairs(l:GetChildren()) do
  239. if b:IsA("Model") then
  240. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "Frost" then
  241. l.Name = "Frost"
  242. table.insert(TreeNames, l.Name)
  243. end
  244. end
  245. end
  246. end
  247. end
  248. end
  249. for i, l in pairs(game:GetService("Workspace"):GetChildren()) do
  250. if l.Name == "TreeRegion" then
  251. if l ~= nil then
  252. for i, b in pairs(l:GetChildren()) do
  253. if b:IsA("Model") then
  254. if b:FindFirstChild("TreeClass") ~= nil and b.TreeClass.Value == "LoneCave" then
  255. l.Name = "LoneCave"
  256. table.insert(TreeNames, l.Name)
  257. end
  258. end
  259. end
  260. end
  261. end
  262. end
  263. --Name Changer Ended
  264. -- Get Generic
  265. for i, v in pairs(workspace:GetChildren()) do
  266. if v:IsA("Model") then
  267. table.insert(target, v)
  268. end
  269. end
  270. --Ended
  271. local bp = game.Players.LocalPlayer.Backpack
  272. local localplayer = game.Players.LocalPlayer
  273. local workspaceaxe = workspace[localplayer.Name]
  274. local plr = game:GetService("Players").LocalPlayer
  275.  
  276. local on = false
  277.  
  278. plr.Chatted:Connect(function(Msg)
  279.  
  280. if Msg:lower() == "e" then
  281.  
  282. on = not on
  283.  
  284. end
  285.  
  286. end)
  287. while true do
  288. wait()
  289. while true do
  290. wait()
  291.  
  292. if on == true then
  293. wait()
  294. if not workspaceaxe:FindFirstChild("Tool") then
  295. workspace:FindFirstChild(plr.Name).Humanoid:EquipTool(game.Players.LocalPlayer.Backpack.Tool)
  296. elseif workspaceaxe:FindFirstChild("Tool") then
  297.  
  298. local choosen = math.random(#target)
  299.  
  300. if _G.print == true then
  301. if target[choosen]:FindFirstChild("Model") and target[choosen].Model:FindFirstChild("TreeClass") then
  302. print("--------------------")
  303. print("Found A Model")
  304. print('Name = ',target[choosen].Model.TreeClass.Value)
  305. print("--------------------")
  306. elseif not target[choosen]:FindFirstChild("Model") then
  307. print("Model Lost, Finding A New Model")
  308. end
  309. end
  310. if target[choosen]:FindFirstChild("Model") then
  311. if not target[choosen].Model:FindFirstChild("WoodSection") then
  312. if _G.print == true then
  313. print("No Wood Section, Skipping Tree!!")
  314. break
  315. end
  316. end
  317. end
  318. if target[choosen] then
  319. if target[choosen]:FindFirstChild("Model") then
  320. if target[choosen].Model:FindFirstChild("WoodSection") then
  321. wait(.5)
  322. --Ended
  323. --Cut Targeted Tree
  324. local A_1 = target[choosen].Model:FindFirstChild("CutEvent")
  325. local A_2 =
  326. {
  327. ["tool"] = workspace:FindFirstChild(plr.Name):FindFirstChild("Tool"),
  328. ["faceVector"] = Vector3.new(-1, 0, 0),
  329. ["height"] = .3,
  330. ["sectionId"] = 1,
  331. ["hitPoints"] = HitPoints[workspace:FindFirstChild(plr.Name).Tool.ToolName.Value],
  332. ["cooldown"] = 0,
  333. ["cuttingClass"] = "Axe"
  334. }
  335. if target[choosen]:FindFirstChild("Model") then
  336. while true do
  337. if workspace[localplayer.Name]:FindFirstChild("Tool") then
  338. end
  339. wait()
  340. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = target[choosen].Model:FindFirstChild("WoodSection").CFrame + Vector3.new(0, 0, -1)
  341. game:GetService("ReplicatedStorage").Interaction.RemoteProxy:FireServer(A_1, A_2)
  342.  
  343. if not target[choosen]:FindFirstChild("Model") then
  344. print("No Wood Section, Skipping")
  345. break
  346. end
  347. if game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y < -100 then
  348. print("Player Glitched Or The Tree Is Under The Map, Skipped The Tree")
  349. break
  350. end
  351. if target[choosen].Model:FindFirstChild("RootCut") then
  352. break
  353. end
  354. wait()
  355. end
  356.  
  357.  
  358. end
  359. end
  360. wait()
  361. target[choosen].Model:Destroy()
  362.  
  363. --Ended
  364.  
  365. wait()
  366. --Ended
  367. --Sell Wood
  368. for _, Log in pairs(workspace.LogModels:GetChildren()) do
  369. if Log.Name:sub(1, 6) == "Loose_" and Log:findFirstChild("Owner") then
  370. if Log.Owner.Value == game.Players.LocalPlayer then
  371. for i,v in pairs(Log:GetChildren()) do
  372. if v.Name=="WoodSection" then
  373. spawn(function()
  374. for i = 1, 5 do
  375. wait()
  376. local choosen = math.random(#dropoff)
  377. v.CFrame=dropoff[choosen]
  378. end
  379. end)
  380. end
  381. end
  382. spawn(function()
  383. for i = 1, 100 do
  384. wait()
  385. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(Log)
  386. end
  387. end)
  388.  
  389. end
  390. end
  391. end
  392. end
  393. end
  394. end
  395. end
  396. end
  397. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement