Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- LocalScript1 = Instance.new("LocalScript")
- Part2 = Instance.new("Part")
- Tool0.Name = "DiamondPickaxe"
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(0.707156658, 0.70705688, 7.0952141e-05)
- Tool0.GripPos = Vector3.new(0.5, -0.25, 0)
- Tool0.GripRight = Vector3.new(-4.39873147e-05, -5.63550238e-05, 1)
- Tool0.GripUp = Vector3.new(-0.70705688, 0.707156658, 8.75029764e-06)
- Tool0.ToolTip = "Используется только для добывания блоков."
- Tool0.CanBeDropped = false
- LocalScript1.Parent = Tool0
- table.insert(cors,sandbox(LocalScript1,function()
- wait(1)
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local createPartButton = script.Parent
- local requestPartEvent = ReplicatedStorage:WaitForChild("axe")
- local player = game.Players.LocalPlayer
- local cursor = player:GetMouse()
- local val = game.Players.LocalPlayer.Backpack.val
- local blocks = game.Lighting:GetChildren()
- local v
- local a = 1
- script.Parent.Activated:connect(function()
- if a == 1 then
- for i = 1, #blocks do
- if blocks[i].Name == cursor.Target.Name then
- v = true
- end
- end
- a = 0
- if v and cursor.Target.Name ~= "sand" and cursor.Target.ClassName == "Part" then
- val.Value = val.Value + 50
- player.PlayerGui.ScreenGui.TextBox.Text = val.Value
- requestPartEvent:FireServer(cursor.Target)
- end
- wait(0.1)
- a = 1
- v = false
- end
- end)
- end))
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.Material = Enum.Material.WoodPlanks
- Part2.BrickColor = BrickColor.new("Burnt Sienna")
- Part2.Size = Vector3.new(2, 2, 2)
- Part2.CFrame = CFrame.new(-132, 1, 106, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.415686, 0.223529, 0.0352941)
- Part2.Position = Vector3.new(-132, 1, 106)
- Part2.Color = Color3.new(0.415686, 0.223529, 0.0352941)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement