Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --tEdit by Coolbob44 -- Version 2.0.0 -- Script Builder Version
- Player_Name = "DeltaDminor"
- ---------------------------------------------------------
- plr=game.Players[Player_Name]
- repeat wait() until plr.Character
- function Create_PrivImpl(objectType)
- if type(objectType) ~= 'string' then
- error("Argument of Create must be a string", 2)
- end
- return function(dat)
- dat = dat or {}
- local obj = Instance.new(objectType)
- local ctor = nil
- for k, v in pairs(dat) do
- if type(k) == 'string' then
- obj[k] = v
- elseif type(k) == 'number' then
- if type(v) ~= 'userdata' then
- error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2)
- end
- v.Parent = obj
- elseif type(k) == 'table' and k.__eventname then
- if type(v) ~= 'function' then
- error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\
- got: "..tostring(v), 2)
- end
- obj[k.__eventname]:connect(v)
- elseif k == Create then
- if type(v) ~= 'function' then
- error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \
- got: "..tostring(v), 2)
- elseif ctor then
- error("Bad entry in Create body: Only one constructor function is allowed", 2)
- end
- ctor = v
- else
- error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2)
- end
- end
- if ctor then
- ctor(obj)
- end
- return obj
- end
- end
- Create = setmetatable({}, {__call = function(tb, ...) return Create_PrivImpl(...) end})
- Create.E = function(eventName)
- return {__eventname = eventName}
- end
- if not script.Parent:IsA("HopperBin") then
- x = Instance.new("HopperBin")
- x.Parent = plr.Backpack
- x.Name = "tE 2"
- script.Parent = x
- else
- max_material = 17
- points={}
- points_show = {}
- undo_hist={}
- redo_hist={}
- SC = {}
- mode = 1
- images = {
- "http://www.roblox.com/asset/?id=33577919";
- "http://www.roblox.com/asset/?id=56563112";
- "http://www.roblox.com/asset/?id=62356652";
- "http://www.roblox.com/asset/?id=65961537";
- "http://www.roblox.com/asset/?id=67532153";
- "http://www.roblox.com/asset/?id=67532038";
- "http://www.roblox.com/asset/?id=67532093";
- "http://www.roblox.com/asset/?id=67531995";
- "http://www.roblox.com/asset/?id=67532118";
- "http://www.roblox.com/asset/?id=67532015";
- "http://www.roblox.com/asset/?id=67532051";
- "http://www.roblox.com/asset/?id=67532206";
- "http://www.roblox.com/asset/?id=67532103";
- "http://www.roblox.com/asset/?id=67531804";
- "http://www.roblox.com/asset/?id=67532059";
- "http://www.roblox.com/asset/?id=67531848";
- "http://www.roblox.com/asset/?id=67531924";
- "http://www.roblox.com/asset/?id=81407474";
- }
- modes = {"Set", "Replace", "Walls", "Outline", "Check"}
- sBox = Create'Model'{
- Create'Part'{
- Name = "One";
- FormFactor = "Custom";
- Size = Vector3.new(4,4,4);
- Transparency = 1;
- Anchored = true;
- CanCollide = false;
- Locked = true;
- };
- Create'Part'{
- Name = "Two";
- FormFactor = "Custom";
- Size = Vector3.new(4,4,4);
- Transparency = 1;
- Anchored = true;
- CanCollide = false;
- Locked = true;
- };
- };
- SelectionBox = Create'SelectionBox'{
- Parent = plr.PlayerGui;
- Adornee = sBox;
- }
- function CreateGui()
- gui = Create'ScreenGui'{
- Name = "tEdit 2";
- Parent = nil;
- Create'TextButton'{
- Name = "Frame";
- Size = UDim2.new(0, 500, 0, 130);
- Position = UDim2.new(0.5, -250, 1, 10);
- Text = "";
- Draggable = true;
- BackgroundTransparency = 1;
- Create'Frame'{
- Size = UDim2.new(1,0,1,0);
- Style = "RobloxRound";
- }
- }
- };
- gmain = gui.Frame.Frame
- modebuttons = {}
- materialbuttons = {}
- mater = nil
- local modeBase = Create'TextButton'{
- Size = UDim2.new(0, 100, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- FontSize = "Size10";
- }
- local matBase = Create'TextButton'{
- Size = UDim2.new(0, 32, 0, 32);
- BackgroundColor3 = Color3.new(50/255, 50/255, 50/255);
- BorderSizePixel = 0;
- Text = "";
- AutoButtonColor = false;
- Create'ImageLabel'{
- Name = "Image";
- Image = "";
- Size = UDim2.new(0, 30, 0, 30);
- Position = UDim2.new(0, 1, 0, 1);
- BackgroundColor3 = Color3.new(80/255, 80/255, 80/255);
- BorderSizePixel = 0;
- BorderColor3 = Color3.new(1,0,0);
- BackgroundTransparency = 1;
- };
- }
- local expandUp = Create'TextButton'{
- Size = UDim2.new(0, 20, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "+";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 420, 0, 10);
- Create'TextLabel'{
- TextXAlignment = "Right";
- Position = UDim2.new(0, -10, 0, 5);
- Text = "Expand";
- TextColor3 = Color3.new(1,1,1);
- };
- };
- local expandDown = Create'TextButton'{
- Size = UDim2.new(0, 20, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "-";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 444, 0, 10);
- };
- local shiftUp = Create'TextButton'{
- Size = UDim2.new(0, 20, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "+";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 420, 0, 35);
- Create'TextLabel'{
- TextXAlignment = "Right";
- Position = UDim2.new(0, -10, 0, 5);
- Text = "Shift";
- TextColor3 = Color3.new(1,1,1);
- };
- };
- local shiftDown = Create'TextButton'{
- Size = UDim2.new(0, 20, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "-";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 444, 0, 35);
- };
- local autoWedge = Create'TextButton'{
- Size = UDim2.new(0, 30, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "AW";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 400, 0, 60);
- };
- local noWedge = Create'TextButton'{
- Size = UDim2.new(0, 30, 0, 20);
- Style = "RobloxButton";
- TextColor3 = Color3.new(1,1,1);
- Text = "NW";
- FontSize = "Size10";
- Parent = gmain;
- Position = UDim2.new(0, 435, 0, 60);
- };
- autoWedge.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- SC:AutoWedge(points[1], points[2])
- end)
- noWedge.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- SC:NoWedge(points[1], points[2])
- end)
- expandUp.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- PointsExpand(1, "u")
- end)
- expandDown.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- PointsExpand(-1, "u")
- end)
- shiftUp.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- PointsShift(1, "u")
- end)
- shiftDown.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- PointsShift(-1, "u")
- end)
- for i, v in pairs(modes) do
- local n = modeBase:Clone()
- n.Parent = gmain
- n.Position = UDim2.new(0, 5, 0, ((i-1)*22) + 7)
- n.Text = v
- if mode == i then
- n.Style = "RobloxButtonDefault"
- end
- n.MouseButton1Click:connect(function()
- for ie, ve in pairs(modebuttons) do
- ve.Style = "RobloxButton"
- end
- for ie, ve in pairs(materialbuttons) do
- ve.Visible = true
- mater = nil
- end
- n.Style = "RobloxButtonDefault"
- mode = i
- mater = nil
- end)
- modebuttons[#modebuttons+1] = n
- end
- local row = 0
- local column = 0
- for i, v in pairs(images) do
- row = row + 1
- if row==8 then
- row = 1
- column = column + 1
- end
- local n = matBase:Clone()
- materialbuttons[#materialbuttons+1] = n
- n.Image.Image = v
- n.Position = UDim2.new(0, 90+(row*35), 0, (column*35)+10)
- n.Parent = gmain
- n.MouseEnter:connect(function()
- n.BackgroundColor3 = Color3.new(1,1,1)
- end)
- n.MouseLeave:connect(function()
- n.BackgroundColor3 = Color3.new(50/255, 50/255, 50/255)
- end)
- n.MouseButton1Click:connect(function()
- if not (points[1] and points[2]) then return end
- if mode == 1 then
- SC:Set(points[1], points[2], i-1)
- elseif mode == 2 then
- if mater then
- SC:Replace(points[1], points[2], i-1, mater)
- for ie, ve in pairs(materialbuttons) do
- ve.Visible = true
- end
- mater = nil
- else
- mater = i-1
- n.Visible = false
- end
- elseif mode == 3 then
- SC:Walls(points[1], points[2], i-1)
- elseif mode == 4 then
- SC:Outline(points[1], points[2], i-1)
- elseif mode == 5 then
- if mater then
- SC:Set(points[1], points[2], i-1, true, mater)
- for ie, ve in pairs(materialbuttons) do
- ve.Visible = true
- end
- mater = nil
- else
- mater = i-1
- n.Visible = false
- end
- end
- end)
- end
- return gui
- end
- function SC:Set(vec1, vec2, m, c, c2)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- table.insert(undo_hist, 1, {})
- while x <= maxX do
- local y=minY
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- local ci1, ci2, ci3 = Workspace.Terrain:GetCell(x, y, z)
- table.insert(undo_hist[1], 1, {Vector3.new(x, y, z), ci1, ci2, ci3})
- if c then
- c3=z+x
- if c3%2==1 then
- Workspace.Terrain:SetCell(x, y, z, c2, 0, 1)
- else
- Workspace.Terrain:SetCell(x, y, z, m, 0, 1)
- end
- else
- Workspace.Terrain:SetCell(x, y, z, m, 0, 1)
- end
- z=z+1
- end
- y=y+1
- end
- x=x+1
- end
- end
- function SC:NoWedge(vec1, vec2)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- while x <= maxX do
- local y=minY
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- local cell,cellt,cello=Workspace.Terrain:GetCell(x, y, z)
- Workspace.Terrain:SetCell(x, y, z, 0, 0, 1)
- Workspace.Terrain:SetCell(x, y, z, cell, 0, 1)
- z=z+1
- end
- y=y+1
- end
- x=x+1
- end
- end
- function SC:AutoWedge(vec1, vec2, m)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- while x <= maxX do
- local y=minY
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- local cell,cellt,cello=Workspace.Terrain:GetCell(x, y, z)
- Workspace.Terrain:AutowedgeCell(x, y, z)
- z=z+1
- end
- y=y+1
- end
- x=x+1
- end
- end
- function SC:Replace(vec1, vec2, m, r)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- while x <= maxX do
- local y=minY
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- local cell,cellt,cello=Workspace.Terrain:GetCell(x, y, z)
- if cell==Enum.CellMaterial:GetEnumItems()[r+1] then
- Workspace.Terrain:SetCell(x, y, z, m, 0, 1)
- end
- z=z+1
- end
- y=y+1
- end
- x=x+1
- end
- end
- function SC:Walls(vec1, vec2, m)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- while x <= maxX do
- local y=minY
- local z=minZ
- while y <= maxY do
- Workspace.Terrain:SetCell(x, y, minZ, m, 0, 1)
- Workspace.Terrain:SetCell(x, y, maxZ, m, 0, 1)
- y=y+1
- end
- x=x+1
- end
- local x=minX
- local y=minY
- local z=minZ
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- Workspace.Terrain:SetCell(minX, y, z, m, 0, 1)
- Workspace.Terrain:SetCell(maxX, y, z, m, 0, 1)
- z=z+1
- end
- y=y+1
- end
- end
- function SC:Outline(vec1, vec2, m)
- local minX=math.min(vec1.x, vec2.x)
- local minY=math.min(vec1.y, vec2.y)
- local minZ=math.min(vec1.z, vec2.z)
- local maxX=math.max(vec1.x, vec2.x)
- local maxY=math.max(vec1.y, vec2.y)
- local maxZ=math.max(vec1.z, vec2.z)
- local x=minX
- local y=minY
- local z=minZ
- while x <= maxX do
- local y=minY
- local z=minZ
- while y <= maxY do
- Workspace.Terrain:SetCell(x, y, minZ, m, 0, 1)
- Workspace.Terrain:SetCell(x, y, maxZ, m, 0, 1)
- y=y+1
- end
- x=x+1
- end
- local x=minX
- local y=minY
- local z=minZ
- while y <= maxY do
- local z=minZ
- while z <= maxZ do
- Workspace.Terrain:SetCell(minX, y, z, m, 0, 1)
- Workspace.Terrain:SetCell(maxX, y, z, m, 0, 1)
- z=z+1
- end
- y=y+1
- end
- local x=minX
- local y=minY
- local z=minZ
- while z <= maxZ do
- local x=minX
- while x <= maxX do
- Workspace.Terrain:SetCell(x, minY, z, m, 0, 1)
- Workspace.Terrain:SetCell(x, maxY, z, m, 0, 1)
- x=x+1
- end
- z=z+1
- end
- end
- function undoLatest()
- if undo_hist[1] then
- table.insert(redo_hist, 1, {})
- for i, v in pairs(undo_hist[1]) do
- local ci1, ci2, ci3 = Workspace.Terrain:GetCell(v[1].x, v[1].y, v[1].z)
- table.insert(redo_hist[1], 1, {Vector3.new(v[1].x, v[1].y, v[1].z), ci1, ci2, ci3})
- Workspace.Terrain:SetCell(v[1].x, v[1].y, v[1].z, v[2], v[3], v[4])
- end
- table.remove(undo_hist, 1)
- end
- end
- function redoLatest()
- if redo_hist[1] then
- table.insert(undo_hist, 1, {})
- for i, v in pairs(redo_hist[1]) do
- local ci1, ci2, ci3 = Workspace.Terrain:GetCell(v[1].x, v[1].y, v[1].z)
- table.insert(undo_hist[1], 1, {Vector3.new(v[1].x, v[1].y, v[1].z), ci1, ci2, ci3})
- Workspace.Terrain:SetCell(v[1].x, v[1].y, v[1].z, v[2], v[3], v[4])
- end
- table.remove(redo_hist, 1)
- end
- end
- function PointsExpand(amt, dir)
- if dir=="u" then
- if points[1].y >= points[2].y then
- points[1]=points[1]+Vector3.new(0,amt,0)
- updateBox()
- else
- points[2]=points[2]+Vector3.new(0,amt,0)
- updateBox()
- end
- elseif dir=="d" then
- if points[1].y <= points[2].y then
- points[1]=points[1]-Vector3.new(0,amt,0)
- updateBox()
- else
- points[2]=points[2]-Vector3.new(0,amt,0)
- updateBox()
- end
- elseif dir=="vert" then
- points[1]=Vector3.new(points[1].x, 0, points[1].z)
- points[2]=Vector3.new(points[2].x, 62, points[2].z)
- updateBox()
- end
- end
- function updateBox()
- if points_show[1] and not points_show[2] then
- sBox.Parent = plr.Character
- SelectionBox.Parent = plr.PlayerGui
- sBox.One.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points_show[1].x, points_show[1].y, points_show[1].z))
- sBox.Two.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points_show[1].x, points_show[1].y, points_show[1].z))
- SelectionBox.Color = BrickColor.new("Really blue")
- elseif points[1] and not points[2] and points_show[2] then
- sBox.Parent = plr.Character
- SelectionBox.Parent = plr.PlayerGui
- sBox.One.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points[1].x, points[1].y, points[1].z))
- sBox.Two.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points_show[2].x, points_show[2].y, points_show[2].z))
- SelectionBox.Color = BrickColor.new("Lime green")
- elseif points[1] and points[2] then
- sBox.Parent = plr.Character
- SelectionBox.Parent = plr.PlayerGui
- sBox.One.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points[1].x, points[1].y, points[1].z))
- sBox.Two.CFrame = CFrame.new(Workspace.Terrain:CellCenterToWorld(points[2].x, points[2].y, points[2].z))
- SelectionBox.Color = BrickColor.new("Really red")
- elseif points == {} and points_show == {} then
- sBox.Parent = nil
- SelectionBox.Parent = nil
- end
- end
- function PointsShift(amt, dir)
- if dir=="u" then
- points[1]=points[1]+Vector3.new(0,amt,0)
- points[2]=points[2]+Vector3.new(0,amt,0)
- updateBox()
- elseif dir=="d" then
- points[1]=points[1]-Vector3.new(0,amt,0)
- points[2]=points[2]-Vector3.new(0,amt,0)
- updateBox()
- end
- end
- function down(mouse)
- if mouse.Target ~= Workspace.Terrain then return end
- local point_terrain = Workspace.Terrain:WorldToCellPreferSolid(mouse.hit.p)
- if #points==0 or #points==2 then
- points = {point_terrain}
- points_show = {point_terrain}
- updateBox()
- else
- points[2]=point_terrain
- points_show[2] = point_terrain
- updateBox()
- end
- end
- function move(mouse)
- if mouse.Target ~= Workspace.Terrain then return end
- local point_terrain = Workspace.Terrain:WorldToCellPreferSolid(mouse.hit.p)
- if points[1] then
- points_show[2] = point_terrain
- else
- points_show[1] = point_terrain
- end
- updateBox()
- end
- function keyDown(k, mouse)
- if k=="c" then
- points = {}
- points_show = {}
- updateBox()
- move(mouse)
- elseif k=="r" then
- if mouse.Target ~= Workspace.Terrain then return end
- local point_terrain = Workspace.Terrain:WorldToCellPreferEmpty(mouse.hit.p)
- Workspace.Terrain:SetCell(point_terrain.x, point_terrain.y, point_terrain.z, 1, 0, 1)
- elseif k=="q" then
- if mouse.Target ~= Workspace.Terrain then return end
- local point_terrain = Workspace.Terrain:WorldToCellPreferSolid(mouse.hit.p)
- Workspace.Terrain:SetCell(point_terrain.x, point_terrain.y, point_terrain.z, 0, 0, 1)
- elseif k=="f" then
- if mouse.Target and plr.Character then
- plr.Character.Torso.CFrame = CFrame.new(mouse.hit.p+Vector3.new(0,3,0))
- end
- end
- end
- plr.Chatted:connect(function(msg)
- if msg:lower():sub(1, 5) == "/set " then
- local mat=msg:sub(6)
- if tonumber(mat) and points[1] and points[2] then
- local mat=tonumber(mat)
- if mat < 0 or mat > max_material then return end
- SC:Set(points[1], points[2], mat)
- end
- print("Set to "..mat)
- elseif msg:lower():sub(1, 3) == "/aw" then
- if not points[1] or not points[2] then return end
- SC:AutoWedge(points[1], points[2])
- print("Autowedged region")
- elseif msg:lower():sub(1, 7) == "/walls " then
- local mat=msg:sub(8)
- if tonumber(mat) and points[1] and points[2] then
- local mat=tonumber(mat)
- if mat < 0 or mat > max_material then return end
- SC:Walls(points[1], points[2], mat)
- end
- print("Set walls to "..mat)
- elseif msg:lower():sub(1, 9) == "/outline " then
- local mat=msg:sub(10)
- if tonumber(mat) and points[1] and points[2] then
- local mat=tonumber(mat)
- if mat < 0 or mat > max_material then return end
- SC:Outline(points[1], points[2], mat)
- end
- print("Outlined with "..mat)
- elseif msg:lower():sub(1, 9) == "/replace " then
- local matt=msg:sub(10)
- local del=matt:find(" ")
- if not del then return end
- mat=matt:sub(1, del-1)
- rep=matt:sub(del+1)
- if tonumber(mat) and tonumber(rep) and points[1] and points[2] then
- local mat=tonumber(mat)
- local rep=tonumber(rep)
- if mat < 0 or mat > max_material then return end
- if rep < 0 or rep > max_material then return end
- SC:Replace(points[1], points[2], rep, mat)
- end
- print("Successfully replaced "..rep.." with "..mat)
- elseif msg:lower():sub(1, 8) == "/expand " then
- local matt=msg:sub(9)
- local del=matt:find(" ")
- if not del then return end
- mat=matt:sub(1, del-1)
- dir=matt:sub(del+1)
- if tonumber(mat) and points[1] and points[2] then
- local mat=tonumber(mat)
- PointsExpand(mat, dir)
- end
- print("Expanded "..mat.." "..dir)
- elseif msg:lower():sub(1, 7) == "/check " then
- local matt=msg:sub(8)
- local del=matt:find(" ")
- if not del then return end
- mat=matt:sub(1, del-1)
- mat2=matt:sub(del+1)
- if tonumber(mat) and tonumber(mat2) and points[1] and points[2] then
- local mat=tonumber(mat)
- local mat2=tonumber(mat2)
- if mat < 0 or mat > max_material then return end
- if mat2 < 0 or mat2 > max_material then return end
- SC:Set(points[1], points[2], mat, true, mat2)
- end
- print("Checked selection with "..mat.." and "..mat2)
- elseif msg:lower():sub(1, 7) == "/shift " then
- local matt=msg:sub(8)
- local del=matt:find(" ")
- if not del then return end
- mat=matt:sub(1, del-1)
- dir=matt:sub(del+1)
- if tonumber(mat) and points[1] and points[2] then
- local mat=tonumber(mat)
- PointsShift(mat, dir)
- end
- print("Shifted "..mat.." "..dir)
- elseif msg:lower():sub(1, 6) == "/evert" then
- PointsExpand(nil, "vert")
- print("Region expanded")
- elseif msg:lower():sub(1, 3) == "/nw" then
- SCnw(points[1], points[2])
- print("Unwedged")
- elseif msg:lower():sub(1, 5) == "/undo" then
- undoLatest()
- print("Undid")
- elseif msg:lower():sub(1, 5) == "/redo" then
- redoLatest()
- print("Redid")
- end
- end)
- function sel(mouse)
- gui = CreateGui()
- gui.Parent = plr.PlayerGui
- gui.Frame:TweenPosition(UDim2.new(0.5, -250, .7, 0), "Out", "Quad", 0.5, true)
- SelectionBox.Parent = plr.PlayerGui
- updateBox()
- move(mouse)
- mouse.Button1Down:connect(function() down(mouse) end)
- mouse.KeyDown:connect(function(k) keyDown(k, mouse) end)
- mouse.Move:connect(function() move(mouse) end)
- end
- function desel()
- points = {}
- points_show = {}
- SelectionBox.Parent = nil
- updateBox()
- if gui then gui.Frame:TweenPosition(UDim2.new(0.5, -250, 1, 5), "Out", "Quad", 0.5) game:service("Debris"):AddItem(gui, .5) end
- end
- script.Parent.Selected:connect(sel)
- script.Parent.Deselected:connect(desel)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement