Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.h = Instance.new("Hint",game.Workspace)
- Instance.new("BindableEvent",game.ReplicatedStorage).Name = "Cut"
- Instance.new("BindableEvent",game.ReplicatedStorage)
- .Name = "Start"
- script.Name = "Main"
- _G.ClientFolder = Instance.new("Folder",game.Workspace)
- _G.ClientFolder.Name="ClientFolder"
- _G.rs = game:GetService("RunService").RenderStepped
- Sc = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
- Sc.Name = "CutAndTP"
- Sc.ResetOnSpawn = false
- _G.GUISS=Sc
- local Sc3 = Instance.new("TextLabel",Sc)
- Sc3.BackgroundColor3 = Color3.new(0.517647, 0.517647, 0.517647)
- Sc3.BackgroundTransparency = 0.2
- Sc3.Name = "Title"
- Sc3.Position = UDim2.new(0, 200, 0, 80)
- Sc3.Size = UDim2.new(0, 200, 0, 20)
- Sc3.Text = "Select a tree"
- Sc3.TextColor3 = Color3.new(0.49, 0.2, 0.40)
- Sc2 = Instance.new("ScrollingFrame",Sc)
- Sc2.Active = true
- Sc2.Draggable = true
- Sc2.BackgroundColor3 = Color3.new(0.517647, 0.517647, 0.517647)
- Sc2.BackgroundTransparency = 0.2
- Sc2.Position = UDim2.new(0, 200, 0, 100)
- Sc2.Size = UDim2.new(0, 200, 0, 300)
- for i,v in pairs(game.Players.LocalPlayer.PlayerGui.CutAndTP.ScrollingFrame:GetChildren()) do
- if v.ClassName == "TextButton" then
- v.MouseButton1Click:connect(function()
- game.ReplicatedStorage.Start:Fire(v.Text)
- end)
- end
- end
- Debounce = false
- game.ReplicatedStorage.Start.Event:connect(function(TreeName)
- _G.GUISS.ScrollingFrame.Visible=false
- _G.GUISS.Title.Visible = false
- _G.h.Text = "Cutting, put away axe to stop"
- for i,v in pairs(game.Workspace:GetChildren()) do
- if v.Name == "TreeRegion" then
- for i,Tree in pairs(v:GetChildren()) do
- _G.rs:wait()
- if Tree:FindFirstChild("TreeClass") and Tree.TreeClass.Value == TreeName then
- TreeC = Tree.TreeClass
- _G.rs:wait()
- _G.h.Text = "Cutting Tree: "..TreeC.Value.." at instance: "..i
- _G.Cutting = true
- _G.FullStop = false
- CutEvent = Tree.CutEvent
- _G.TREECHILDREN = #CutEvent.Parent:GetChildren()
- repeat
- _G.rs:wait()
- game.ReplicatedStorage.Cut:Fire(CutEvent)
- until _G.Cutting == false or _G.FullStop == true
- if _G.FullStop == true then
- _G.GUISS.ScrollingFrame.Visible = true _G.GUISS.Title.Visible = true
- _G.h.Text = "Cutting is stopped, click a tree to start."
- return
- end
- for i,Log in pairs(game.Workspace.LogModels:GetChildren()) do
- _G.rs:wait()
- if Log:IsA("Model") and Log:FindFirstChild("Owner") and (Log.Owner.Value == game.Players.LocalPlayer or Log.Owner.Value == nil) and Log.TreeClass.Value == TreeName then
- game.ReplicatedStorage.Interaction.Verify:FireServer('Item owned by player',Log)
- Log:MoveTo(game.Players.LocalPlayer.Character.Head.Position)
- game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(Log)
- Log.Parent=_G.ClientFolder
- wait(0.1)
- end
- end
- end
- end
- _G.GUISS.ScrollingFrame.Visible = true _G.GUISS.Title.Visible = true
- end
- _G.h.Text = "Out of trees, or no trees found! Please select another tree."
- end
- end)
- OldP = 0
- _G.Cutting = true
- _G.FullStop = false
- NotFound = false
- _G.h.Text = "Cutting is stopped, click a tree to start."
- for i,v in pairs(game.Workspace:GetChildren()) do
- if v.Name == "TreeRegion" and v:FindFirstChild("Model") and v.Model:FindFirstChild("TreeClass") then
- TreeC = v.Model.TreeClass.Value
- GUI = Instance.new("TextButton",_G.GUISS.ScrollingFrame)
- GUI.Name = TreeC
- GUI.Text = TreeC
- GUI.TextWrapped = true
- GUI.TextScaled = true
- GUI.BackgroundTransparency = 0.2
- GUI.Size = UDim2.new(0,100,0,40)
- if OldP == 0 then
- OldP = 10
- GUI.Position = UDim2.new(0,50,0,OldP)
- else
- OldP = OldP+50
- GUI.Position = UDim2.new(0,50,0,OldP)
- end
- end
- end
- _G.GUISS.ScrollingFrame.Visible = true _G.GUISS.Title.Visible = true
- for i,v in pairs(_G.GUISS.ScrollingFrame:GetChildren()) do
- if v.ClassName == "TextButton" then
- v.MouseButton1Click:connect(function()
- game.ReplicatedStorage.Start:Fire(v.Text)
- end)
- end
- end
- _G.hitpoints = {}
- _G.hitpoints.Axe1 = {0.55}
- _G.hitpoints.Axe2 = {0.93}
- _G.hitpoints.Axe3 = {1.45}
- _G.hitpoints.AxeAlphaTesters = {1.5}
- _G.hitpoints.AxeBetaTesters = {1.45}
- _G.hitpoints.BasicHatchet = {0.2}
- _G.hitpoints.CandyCaneAxe = {0}
- _G.hitpoints.EndTimesAxe = {1.58,"LoneCave",1e7}
- _G.hitpoints.FireAxe = {"Volcano",6.35}
- _G.hitpoints.GoldAxe = {50}
- _G.hitpoints.Rukiryaxe = {1.68}
- _G.hitpoints.SilverAxe = {1.6}
- HitPoints = 0
- Continue = false
- game.ReplicatedStorage.Cut.Event:connect(function(CutEvent)
- _G.h.Text = "Cutting: "..CutEvent.Parent.TreeClass.Value
- if game.Players.LocalPlayer.Character:FindFirstChild("Tool") then
- Tool = game.Players.LocalPlayer.Character.Tool
- ToolNaME = Tool.ToolName.Value
- Continue = true
- else
- game.ReplicatedStorage.Notices.SendUserNotice:Fire("Hold an axe to use this script!")
- Continue = false
- _G.FullStop = true
- _G.Cutting = false
- return
- end
- if Continue == true then
- if CutEvent.Parent.TreeClass.Value == _G.hitpoints[ToolNaME][2] then
- HitPoints = _G.hitpoints[ToolNaME][3]
- else
- HitPoints = _G.hitpoints[ToolNaME][1]
- end
- Continue = false
- for i,v in pairs(CutEvent.Parent:GetChildren()) do
- game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(CutEvent,{tool=Tool, faceVector=Vector3.new(0, 0, 1), height=1, sectionId=1, hitPoints=HitPoints, cooldown=0, cuttingClass="Axe"})
- if #CutEvent.Parent:GetChildren() ~= _G.TREECHILDREN then
- _G.Cutting = false
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement