Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local scriptloaded = tick()
- local server = NS([[
- local rem = Instance.new("RemoteEvent",owner.Character)
- rem.Name = "SuperRemote"
- local debris = game:GetService("Debris")
- rem.OnServerEvent:Connect(function(plr,args,args2,origp)
- pcall(function()
- origp:Destroy()
- local p1 = Instance.new("Part")
- p1.Material = args[1]
- p1.Size = args[2]
- p1.CFrame = args[3]
- p1.Color = args[4]
- p1.TopSurface = args[5]
- p1.BottomSurface = args[6]
- p1.RightSurface = args[7]
- p1.LeftSurface = args[8]
- p1.FrontSurface = args[9]
- p1.BackSurface = args[10]
- p1.Transparency = args[11]
- local p2 = Instance.new("Part")
- p2.Material = args2[1]
- p2.Size = args2[2]
- p2.CFrame = args2[3]
- p2.Color = args2[4]
- p2.TopSurface = args2[5]
- p2.BottomSurface = args2[6]
- p2.RightSurface = args2[7]
- p2.LeftSurface = args2[8]
- p2.FrontSurface = args2[9]
- p2.BackSurface = args2[10]
- p2.Transparency = args2[11]
- p1.Parent = workspace
- p2.Parent = workspace
- spawn(function()
- debris:AddItem(p1,math.random(20,30))
- debris:AddItem(p2,math.random(20,30))
- end)
- end)
- end)
- ]],owner.Character)
- local movestuds = .1
- local rem = owner.Character:WaitForChild("SuperRemote",20)
- local plr = game:GetService("Players").LocalPlayer
- local mouse = plr:GetMouse()
- local char = plr.Character
- local h = char:WaitForChild("Head",10)
- local using = false
- local choosing = false
- local target_anchored = false
- local target = nil
- local targetcf = nil
- local axis = "y"
- local curaxis = 2
- local tweens = game:GetService("TweenService")
- local debrs = game:GetService("Debris")
- local ins = Instance
- local inn = ins.new
- local c3 = Color3.new
- local v3 = Vector3.new
- local bc = BrickColor
- local cfn = CFrame.new
- local eas = Enum.EasingStyle.Sine
- local ead = Enum.EasingDirection.In
- local cor = coroutine.resume
- local coc = coroutine.create
- local huge = math.huge
- local bc = BrickColor
- local selectbox = inn("SelectionBox",char) selectbox.Color3 = c3(1,1,1) selectbox.LineThickness = .02 selectbox.Adornee = nil selectbox.Transparency = 1
- local cutselect = inn("Part",h) cutselect.Size = v3(1,1,1) cutselect.Material = "Neon" cutselect.BrickColor = bc.new("CGA brown") cutselect.CanCollide = false cutselect.Anchored = true cutselect.CFrame = CFrame.new(999,999,999)
- local dpart = Instance.new("Part",h) dpart.Size = v3(.1,.1,.1) dpart.Anchored = true dpart.Transparency = 1 dpart.CanCollide = true dpart.CFrame = CFrame.new(999,999,999)
- local cmesh = inn("BlockMesh",cutselect)
- local force = inn("BodyVelocity") force.MaxForce = v3(huge,huge,huge)
- --functions
- local tlerp = function(part,tablee,lenght,easingstyle,easingdirec)
- local info = TweenInfo.new(
- lenght,
- easingstyle,
- easingdirec,
- 0,
- false,
- 0
- )
- local lerp = tweens:Create(part,info,tablee)
- lerp:Play()
- end
- function selecttarget(targe)
- if target ~= nil then
- removetarget()
- end
- using = true
- targetcf = targe.CFrame
- cutselect.CFrame = targe.CFrame
- selectbox.Transparency = 1
- cutselect.Transparency = 1
- selectbox.Adornee = targe
- if axis == "x" then
- cmesh.Scale = v3(.05,targe.Size.y+.05,targe.Size.z+.1)
- elseif axis == "y" then
- cmesh.Scale = v3(targe.Size.x+.1,.05,targe.Size.z+.1)
- elseif axis == "z" then
- cmesh.Scale = v3(targe.Size.x+.05,targe.Size.y+.1,.05)
- end
- if targe.Anchored == true then
- target_anchored = true
- else
- target_anchored = false
- end
- targe.Anchored = true
- for i = 1,5 do
- selectbox.Transparency = selectbox.Transparency -.2
- cutselect.Transparency = cutselect.Transparency -.2
- wait()
- end
- target = targe
- choosing = true
- using = false
- end
- function removetarget()
- using = true
- selectbox.Transparency = 0
- cutselect.Transparency = 0
- for i = 1,5 do
- selectbox.Transparency = selectbox.Transparency +.2
- cutselect.Transparency = cutselect.Transparency +.2
- wait()
- end
- cutselect.CFrame = CFrame.new(999,999,999)
- if target ~= nil then
- if target_anchored == true then
- target.Anchored = true
- else
- target.Anchored = false
- end
- end
- choosing = false
- selectbox.Adornee = nil
- target = nil
- using = false
- end
- function movecs(upordown)
- if target ~= nil then
- if upordown == "up" then
- if axis == "x" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(movestuds,0,0)
- elseif axis == "y" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(0,movestuds,0)
- elseif axis == "z" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(0,0,movestuds)
- end
- elseif upordown == "down" then
- if axis == "x" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(-movestuds,0,0)
- elseif axis == "y" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(0,-movestuds,0)
- elseif axis == "z" then
- cutselect.CFrame = cutselect.CFrame * CFrame.new(0,0,-movestuds)
- end
- end
- end
- end
- function cut(dist)
- if target ~= nil then
- target:ClearAllChildren()
- local clone1 = target:Clone()
- local clone2 = target:Clone()
- clone1.Parent = workspace
- clone2.Parent = workspace
- if axis == "x" then
- clone1.Size = v3(dist,target.Size.y,target.Size.z)
- clone2.Size = v3(target.Size.x-dist,target.Size.y,target.Size.z)
- clone1.CFrame = target.CFrame * CFrame.new((target.Size.x-dist)/2,0,0)
- clone2.CFrame = target.CFrame * CFrame.new(-dist/2,0,0)
- elseif axis == "y" then
- clone1.Size = v3(target.Size.x,dist,target.Size.z)
- clone2.Size = v3(target.Size.x,target.Size.y-dist,target.Size.z)
- clone1.CFrame = target.CFrame * CFrame.new(0,(target.Size.y-dist)/2,0)
- clone2.CFrame = target.CFrame * CFrame.new(0,-dist/2,0)
- elseif axis == "z" then
- clone1.Size = v3(target.Size.x,target.Size.y,dist)
- clone2.Size = v3(target.Size.x,target.Size.y,target.Size.z-dist)
- clone1.CFrame = target.CFrame * CFrame.new(0,0,(target.Size.z-dist)/2)
- clone2.CFrame = target.CFrame * CFrame.new(0,0,-dist/2)
- end
- clone1.Anchored = false
- clone2.Anchored = false
- clone1.CanCollide = true
- clone2.CanCollide = true
- clone1:BreakJoints()
- clone2:BreakJoints()
- local tabl1 = {clone1.Material,clone1.Size,clone1.CFrame,clone1.Color,clone1.TopSurface,clone1.BottomSurface,clone1.RightSurface,clone1.LeftSurface,clone1.FrontSurface,clone1.BackSurface,clone1.Transparency}
- local tabl2 = {clone2.Material,clone2.Size,clone2.CFrame,clone2.Color,clone2.TopSurface,clone2.BottomSurface,clone2.RightSurface,clone2.LeftSurface,clone2.FrontSurface,clone2.BackSurface,clone2.Transparency}
- rem:FireServer(tabl1,tabl2,target)
- clone1:Destroy()
- clone2:Destroy()
- target = nil
- removetarget()
- else removetarget() return warn("Can`t cut a nil instance.")
- end
- end
- mouse.KeyDown:Connect(function(key)
- if not using then
- if key == "e" and mouse.Target ~= nil and mouse.Target ~= cutselect and mouse.Target ~= dpart then
- selecttarget(mouse.Target)
- end
- if key == "q" and choosing then
- removetarget()
- end
- if key == "r" and target ~= nil then
- movecs("up")
- elseif key == "f" and target ~= nil then
- movecs("down")
- end
- if key == "t" then
- curaxis = curaxis +1
- if curaxis >3 then
- curaxis = 1
- end
- if target ~= nil then
- cutselect.CFrame = target.CFrame
- end
- print(curaxis)
- end
- end
- end)
- mouse.Button1Down:Connect(function()
- if target ~= nil then
- cut((cutselect.Position-dpart.Position).Magnitude)
- end
- end)
- local colorc = coroutine.wrap(function()
- while true do
- tlerp(selectbox,{Color3 = c3(0,0,0)},.5,eas,ead)
- wait(.5)
- tlerp(selectbox,{Color3 = c3(1,1,1)},.5,eas,ead)
- wait(.5)
- end
- end)
- plr.Chatted:Connect(function(msg)
- if msg:lower():sub(1,9) == "/e studs/" then
- movestuds = tonumber(msg:sub(10,#msg))
- end
- end)
- coroutine.resume(coroutine.create(function()
- while true do
- if curaxis == 1 then
- axis = "x"
- elseif curaxis == 2 then
- axis = "y"
- elseif curaxis == 3 then
- axis = "z"
- end
- if target ~= nil then
- if axis == "x" then
- cmesh.Scale = v3(.05,target.Size.y+.1,target.Size.z+.1)
- elseif axis == "y" then
- cmesh.Scale = v3(target.Size.x+.1,.05,target.Size.z+.1)
- elseif axis == "z" then
- cmesh.Scale = v3(target.Size.x+.1,target.Size.y+.1,.05)
- end
- target.CFrame = targetcf
- if axis == "x" then
- dpart.CFrame = target.CFrame * CFrame.new(target.Size.x/2,0,0)
- elseif axis == "y" then
- dpart.CFrame = target.CFrame * CFrame.new(0,target.Size.y/2,0)
- elseif axis == "z" then
- dpart.CFrame = target.CFrame * CFrame.new(0,0,target.Size.z/2)
- end
- else
- dpart.CFrame = CFrame.new(999,999,999)
- end
- wait()
- end
- end))
- colorc()
- print("Time spent to load the script: "..tick()-scriptloaded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement