Advertisement
vL4d_4eVer

yeee dab

Sep 29th, 2018
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.51 KB | None | 0 0
  1. local scriptloaded = tick()
  2. local server = NS([[
  3. local rem = Instance.new("RemoteEvent",owner.Character)
  4. rem.Name = "SuperRemote"
  5. local debris = game:GetService("Debris")
  6. rem.OnServerEvent:Connect(function(plr,args,args2,origp)
  7.     pcall(function()
  8.     origp:Destroy()
  9.     local p1 = Instance.new("Part")
  10.     p1.Material = args[1]
  11.     p1.Size = args[2]
  12.     p1.CFrame = args[3]
  13.     p1.Color = args[4]
  14.     p1.TopSurface = args[5]
  15.     p1.BottomSurface = args[6]
  16.     p1.RightSurface = args[7]
  17.     p1.LeftSurface = args[8]
  18.     p1.FrontSurface = args[9]
  19.     p1.BackSurface = args[10]
  20.     p1.Transparency = args[11]
  21.     local p2 = Instance.new("Part")
  22.     p2.Material = args2[1]
  23.     p2.Size = args2[2]
  24.     p2.CFrame = args2[3]
  25.     p2.Color = args2[4]
  26.     p2.TopSurface = args2[5]
  27.     p2.BottomSurface = args2[6]
  28.     p2.RightSurface = args2[7]
  29.     p2.LeftSurface = args2[8]
  30.     p2.FrontSurface = args2[9]
  31.     p2.BackSurface = args2[10]
  32.     p2.Transparency = args2[11]
  33.     p1.Parent = workspace
  34.     p2.Parent = workspace
  35.     spawn(function()
  36.         debris:AddItem(p1,math.random(20,30))
  37.         debris:AddItem(p2,math.random(20,30))
  38.     end)
  39. end)
  40. end)
  41. ]],owner.Character)
  42. local movestuds = .1
  43. local rem = owner.Character:WaitForChild("SuperRemote",20)
  44. local plr = game:GetService("Players").LocalPlayer
  45. local mouse = plr:GetMouse()
  46. local char = plr.Character
  47. local h = char:WaitForChild("Head",10)
  48. local using = false
  49. local choosing = false
  50. local target_anchored = false
  51. local target = nil
  52. local targetcf = nil
  53. local axis = "y"
  54. local curaxis = 2
  55. local tweens = game:GetService("TweenService")
  56. local debrs = game:GetService("Debris")
  57. local ins = Instance
  58. local inn = ins.new
  59. local c3 = Color3.new
  60. local v3 = Vector3.new
  61. local bc = BrickColor
  62. local cfn = CFrame.new
  63. local eas = Enum.EasingStyle.Sine
  64. local ead = Enum.EasingDirection.In
  65. local cor = coroutine.resume
  66. local coc = coroutine.create
  67. local huge = math.huge
  68. local bc = BrickColor
  69. local selectbox = inn("SelectionBox",char) selectbox.Color3 = c3(1,1,1) selectbox.LineThickness = .02 selectbox.Adornee = nil selectbox.Transparency = 1
  70. 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)
  71. 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)
  72. local cmesh = inn("BlockMesh",cutselect)
  73. local force = inn("BodyVelocity") force.MaxForce = v3(huge,huge,huge)
  74. --functions
  75. local tlerp = function(part,tablee,lenght,easingstyle,easingdirec)
  76.     local info = TweenInfo.new(
  77.     lenght,
  78.     easingstyle,
  79.     easingdirec,
  80.     0,
  81.     false,
  82.     0
  83.     )
  84.     local lerp = tweens:Create(part,info,tablee)
  85.     lerp:Play()
  86. end
  87. function selecttarget(targe)
  88.     if target ~= nil then
  89.         removetarget()
  90.     end
  91.     using = true
  92.     targetcf = targe.CFrame
  93.     cutselect.CFrame = targe.CFrame
  94.     selectbox.Transparency = 1
  95.     cutselect.Transparency = 1
  96.     selectbox.Adornee = targe
  97.     if axis == "x" then
  98.         cmesh.Scale = v3(.05,targe.Size.y+.05,targe.Size.z+.1)
  99.     elseif axis == "y" then
  100.         cmesh.Scale = v3(targe.Size.x+.1,.05,targe.Size.z+.1)
  101.     elseif axis == "z" then
  102.         cmesh.Scale = v3(targe.Size.x+.05,targe.Size.y+.1,.05)
  103.     end
  104.     if targe.Anchored == true then
  105.         target_anchored = true
  106.     else
  107.         target_anchored = false
  108.     end
  109.     targe.Anchored = true
  110.     for i = 1,5 do
  111.         selectbox.Transparency = selectbox.Transparency -.2
  112.         cutselect.Transparency = cutselect.Transparency -.2
  113.         wait()
  114.     end
  115.     target = targe
  116.     choosing = true
  117.     using = false
  118. end
  119. function removetarget()
  120.     using = true
  121.     selectbox.Transparency = 0
  122.     cutselect.Transparency = 0
  123.     for i = 1,5 do
  124.         selectbox.Transparency = selectbox.Transparency +.2
  125.         cutselect.Transparency = cutselect.Transparency +.2
  126.         wait()
  127.     end
  128.     cutselect.CFrame = CFrame.new(999,999,999)
  129.     if target ~= nil then
  130.         if target_anchored == true then
  131.             target.Anchored = true
  132.         else
  133.             target.Anchored = false
  134.         end
  135.     end
  136.     choosing = false
  137.     selectbox.Adornee = nil
  138.     target = nil
  139.     using = false
  140. end
  141. function movecs(upordown)
  142.     if target ~= nil then
  143.         if upordown == "up" then
  144.             if axis == "x" then
  145.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(movestuds,0,0)
  146.             elseif axis == "y" then
  147.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(0,movestuds,0)
  148.             elseif axis == "z" then
  149.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(0,0,movestuds)
  150.             end
  151.         elseif upordown == "down" then
  152.             if axis == "x" then
  153.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(-movestuds,0,0)
  154.             elseif axis == "y" then
  155.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(0,-movestuds,0)
  156.             elseif axis == "z" then
  157.                 cutselect.CFrame = cutselect.CFrame * CFrame.new(0,0,-movestuds)
  158.             end
  159.         end
  160.     end
  161. end
  162. function cut(dist)
  163.     if target ~= nil then
  164.         target:ClearAllChildren()
  165.             local clone1 = target:Clone()
  166.             local clone2 = target:Clone()
  167.             clone1.Parent = workspace
  168.             clone2.Parent = workspace
  169.             if axis == "x" then
  170.                 clone1.Size = v3(dist,target.Size.y,target.Size.z)
  171.                 clone2.Size = v3(target.Size.x-dist,target.Size.y,target.Size.z)
  172.                 clone1.CFrame = target.CFrame * CFrame.new((target.Size.x-dist)/2,0,0)
  173.                 clone2.CFrame = target.CFrame * CFrame.new(-dist/2,0,0)
  174.             elseif axis == "y" then
  175.                 clone1.Size = v3(target.Size.x,dist,target.Size.z)
  176.                 clone2.Size = v3(target.Size.x,target.Size.y-dist,target.Size.z)
  177.                 clone1.CFrame = target.CFrame * CFrame.new(0,(target.Size.y-dist)/2,0)
  178.                 clone2.CFrame = target.CFrame * CFrame.new(0,-dist/2,0)
  179.             elseif axis == "z" then
  180.                 clone1.Size = v3(target.Size.x,target.Size.y,dist)
  181.                 clone2.Size = v3(target.Size.x,target.Size.y,target.Size.z-dist)
  182.                 clone1.CFrame = target.CFrame * CFrame.new(0,0,(target.Size.z-dist)/2)
  183.                 clone2.CFrame = target.CFrame * CFrame.new(0,0,-dist/2)
  184.             end
  185.             clone1.Anchored = false
  186.             clone2.Anchored = false
  187.             clone1.CanCollide = true
  188.             clone2.CanCollide = true
  189.             clone1:BreakJoints()
  190.             clone2:BreakJoints()
  191.             local tabl1 = {clone1.Material,clone1.Size,clone1.CFrame,clone1.Color,clone1.TopSurface,clone1.BottomSurface,clone1.RightSurface,clone1.LeftSurface,clone1.FrontSurface,clone1.BackSurface,clone1.Transparency}
  192.             local tabl2 = {clone2.Material,clone2.Size,clone2.CFrame,clone2.Color,clone2.TopSurface,clone2.BottomSurface,clone2.RightSurface,clone2.LeftSurface,clone2.FrontSurface,clone2.BackSurface,clone2.Transparency}
  193.             rem:FireServer(tabl1,tabl2,target)
  194.             clone1:Destroy()
  195.             clone2:Destroy()
  196.             target = nil
  197.             removetarget()
  198.         else removetarget() return warn("Can`t cut a nil instance.")
  199.     end
  200. end
  201. mouse.KeyDown:Connect(function(key)
  202.     if not using then
  203.     if key == "e" and mouse.Target ~= nil and mouse.Target ~= cutselect and mouse.Target ~= dpart then
  204.         selecttarget(mouse.Target)
  205.     end
  206.     if key == "q" and choosing then
  207.         removetarget()
  208.     end
  209.     if key == "r" and target ~= nil then
  210.         movecs("up")
  211.     elseif key == "f" and target ~= nil then
  212.         movecs("down")
  213.     end
  214.     if key == "t" then
  215.         curaxis = curaxis +1
  216.         if curaxis >3 then
  217.             curaxis = 1
  218.         end
  219.         if target ~= nil then
  220.         cutselect.CFrame = target.CFrame
  221.         end
  222.         print(curaxis)
  223.     end
  224.     end
  225. end)
  226. mouse.Button1Down:Connect(function()
  227.     if target ~= nil then
  228.         cut((cutselect.Position-dpart.Position).Magnitude)
  229.     end
  230. end)
  231. local colorc = coroutine.wrap(function()
  232.     while true do
  233.         tlerp(selectbox,{Color3 = c3(0,0,0)},.5,eas,ead)
  234.         wait(.5)
  235.         tlerp(selectbox,{Color3 = c3(1,1,1)},.5,eas,ead)
  236.         wait(.5)
  237.     end
  238. end)
  239. plr.Chatted:Connect(function(msg)
  240. if msg:lower():sub(1,9) == "/e studs/" then
  241. movestuds = tonumber(msg:sub(10,#msg))
  242. end
  243. end)
  244. coroutine.resume(coroutine.create(function()
  245.     while true do
  246.         if curaxis == 1 then
  247.             axis = "x"
  248.         elseif curaxis == 2 then
  249.             axis = "y"
  250.         elseif curaxis == 3 then
  251.             axis = "z"
  252.         end
  253.         if target ~= nil then
  254.             if axis == "x" then
  255.                 cmesh.Scale = v3(.05,target.Size.y+.1,target.Size.z+.1)
  256.             elseif axis == "y" then
  257.                 cmesh.Scale = v3(target.Size.x+.1,.05,target.Size.z+.1)
  258.             elseif axis == "z" then
  259.                 cmesh.Scale = v3(target.Size.x+.1,target.Size.y+.1,.05)
  260.             end
  261.             target.CFrame = targetcf
  262.             if axis == "x" then
  263.                 dpart.CFrame = target.CFrame * CFrame.new(target.Size.x/2,0,0)
  264.             elseif axis == "y" then
  265.                 dpart.CFrame = target.CFrame * CFrame.new(0,target.Size.y/2,0)
  266.             elseif axis == "z" then
  267.                 dpart.CFrame = target.CFrame * CFrame.new(0,0,target.Size.z/2)
  268.             end
  269.         else
  270.             dpart.CFrame = CFrame.new(999,999,999)
  271.         end
  272.         wait()
  273.     end
  274. end))
  275. colorc()
  276. print("Time spent to load the script: "..tick()-scriptloaded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement