Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OnlineMode=false; --online mode has a system of permissions. Offline mode does not.
- admins={"advancedev",game.Players.LocalPlayer}; --People who get to adjust other people's settings set toward them, as well as save *every* brick (including bricks that weren't made with the build tool). Also, admins get the insert tool.
- player=game.Players.LocalPlayer;
- local Build = Instance.new("HopperBin")
- Build.BinType = "Script"
- Build.Name = "Build Tool"
- Build.Parent = player.Backpack
- Options={
- RepeatDelay=1, --for holding tab
- RepeatRate=.03, --for holding tab
- DoubleClickSpeed=.3, --how fast must you double click to select a model
- BoundingBoxColor=BrickColor.new("Cyan"),
- ActiveSelectionBoxColor=BrickColor.new("Really red"),
- SurfaceSelectionColor=BrickColor.new("Bright violet"),
- DragHandlesColor=BrickColor.new("Bright orange"),
- RotateHandlesColor=BrickColor.new("Bright red"),
- ResizeHandlesColor=BrickColor.new("Bright blue"),
- --Sooner or later, I may make all functions pay mind to these values.
- SelectedColor=Color3.new(51/255, 153/255, 255/255), --a blue to denote the button is selected
- ButtonColor=Color3.new(245/255, 245/255, 245/255), --a white to denote the button can be pressed
- InactiveColor=Color3.new(120/255, 120/255, 120/255), --a grey to denote the button can't be clicked
- ToolTipColor=Color3.new(254/255, 214/255, 145/255); --a tan (microsoft default)
- MainColor=Color3.new(211/255,243/255,255/255); --a light blue for the background of all frames
- MoveDragIntervals=1,
- RotateDragIntervals=5,
- ResizeDragIntervals=1,
- SmallestSize=Vector3.new(1, 1, 1);
- DockVisible=true,
- CloneShift=true, --when you clone, should the new part appear above the previous, or in the same location?
- ThreeAxes=false, --show the 3 axes objects
- ToolTipText = "on"; --on, off, immediate
- }
- while workspace.CurrentCamera:findFirstChild("LocalBin")~=nil do workspace.CurrentCamera.LocalBin:remove(); end
- LocalBin=Instance.new("Model");
- LocalBin.Name="LocalBin";
- obj1=Instance.new("Frame") obj1.BackgroundColor3=Color3.new(166/255,165/255,168/255) obj1.BorderColor3=Color3.new(27/255,42/255,53/255) obj1.Position=UDim2.new(0,10,1,-50) obj1.Size=UDim2.new(0,0,0,0)
- obj2=Instance.new("Frame") obj2.BackgroundColor3=Color3.new(208/255,240/255,255/255) obj2.BorderColor3=Color3.new(27/255,42/255,53/255) obj2.Name="Main" obj2.Parent=obj1 obj2.Position=UDim2.new(0,0,1,-200) obj2.Size=UDim2.new(0,239,0,200)
- obj3=Instance.new("ImageButton") obj3.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj3.BorderColor3=Color3.new(27/255,42/255,53/255) obj3.Image="http://www.roblox.com/asset/?id=36662758" obj3.Name="Button1" obj3.Parent=obj2 obj3.Position=UDim2.new(0,2,0,2) obj3.Size=UDim2.new(0,97,0,97)
- obj4=Instance.new("ImageButton") obj4.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj4.BorderColor3=Color3.new(27/255,42/255,53/255) obj4.Image="http://www.roblox.com/asset/?id=36662767" obj4.Name="Button3" obj4.Parent=obj2 obj4.Position=UDim2.new(0,2,0,101) obj4.Size=UDim2.new(0,97,0,97)
- obj5=Instance.new("ImageButton") obj5.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj5.BorderColor3=Color3.new(27/255,42/255,53/255) obj5.Image="http://www.roblox.com/asset/?id=36662771" obj5.Name="Button4" obj5.Parent=obj2 obj5.Position=UDim2.new(0,101,0,101) obj5.Size=UDim2.new(0,97,0,97)
- obj6=Instance.new("ImageButton") obj6.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj6.BorderColor3=Color3.new(27/255,42/255,53/255) obj6.Image="http://www.roblox.com/asset/?id=36662760" obj6.Name="Button2" obj6.Parent=obj2 obj6.Position=UDim2.new(0,101,0,2) obj6.Size=UDim2.new(0,97,0,97)
- obj7=Instance.new("ImageButton") obj7.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj7.BorderColor3=Color3.new(27/255,42/255,53/255) obj7.Image="http://www.roblox.com/asset/?id=36663907" obj7.Name="Tab1" obj7.Parent=obj2 obj7.Position=UDim2.new(0,200,0,2) obj7.Size=UDim2.new(0,37,0,38)
- obj8=Instance.new("ImageButton") obj8.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj8.BorderColor3=Color3.new(27/255,42/255,53/255) obj8.Name="Tab2" obj8.Parent=obj2 obj8.Position=UDim2.new(0,200,0,42) obj8.Size=UDim2.new(0,37,0,37)
- obj9=Instance.new("ImageButton") obj9.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj9.BorderColor3=Color3.new(27/255,42/255,53/255) obj9.Name="Tab3" obj9.Parent=obj2 obj9.Position=UDim2.new(0,200,0,81) obj9.Size=UDim2.new(0,37,0,38)
- obj10=Instance.new("ImageButton") obj10.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj10.BorderColor3=Color3.new(27/255,42/255,53/255) obj10.Name="Tab4" obj10.Parent=obj2 obj10.Position=UDim2.new(0,200,0,121) obj10.Size=UDim2.new(0,37,0,37)
- obj11=Instance.new("ImageButton") obj11.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj11.BorderColor3=Color3.new(27/255,42/255,53/255) obj11.Name="Tab5" obj11.Parent=obj2 obj11.Position=UDim2.new(0,200,0,160) obj11.Size=UDim2.new(0,37,0,38)
- gui1=Instance.new("Frame") gui1.BackgroundColor3=Options.MainColor gui1.BorderColor3=Color3.new(27/255,42/255,53/255) gui1.Name="Dock" gui1.Position=UDim2.new(0,0,1,-422) gui1.Size=UDim2.new(0,158,0,218)
- gui2=Instance.new("TextButton") gui2.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui2.BorderColor3=Color3.new(27/255,42/255,53/255) gui2.Name="pos_x" gui2.Parent=gui1 gui2.Position=UDim2.new(0,2,0,17) gui2.Size=UDim2.new(0,50,0,14) gui2.Text="x_pos" gui2.TextColor3=Color3.new(27/255,42/255,53/255)
- gui3=Instance.new("TextLabel") gui3.Active=false gui3.BackgroundColor3=Color3.new(170/255,169/255,172/255) gui3.BackgroundTransparency=1 gui3.BorderColor3=Color3.new(27/255,42/255,53/255) gui3.Name="Position" gui3.Parent=gui1 gui3.Position=UDim2.new(0,2,0,2) gui3.Size=UDim2.new(0,154,0,13) gui3.Text="Position" gui3.TextColor3=Color3.new(27/255,42/255,53/255)
- gui4=Instance.new("TextButton") gui4.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui4.BorderColor3=Color3.new(27/255,42/255,53/255) gui4.Name="pos_y" gui4.Parent=gui1 gui4.Position=UDim2.new(0,54,0,17) gui4.Size=UDim2.new(0,50,0,14) gui4.Text="y_pos" gui4.TextColor3=Color3.new(27/255,42/255,53/255)
- gui5=Instance.new("TextButton") gui5.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui5.BorderColor3=Color3.new(27/255,42/255,53/255) gui5.Name="pos_z" gui5.Parent=gui1 gui5.Position=UDim2.new(0,106,0,17) gui5.Size=UDim2.new(0,50,0,14) gui5.Text="z_pos" gui5.TextColor3=Color3.new(27/255,42/255,53/255)
- gui6=Instance.new("TextLabel") gui6.Active=false gui6.BackgroundColor3=Color3.new(171/255,170/255,173/255) gui6.BackgroundTransparency=1 gui6.BorderColor3=Color3.new(27/255,42/255,53/255) gui6.Name="Size" gui6.Parent=gui1 gui6.Position=UDim2.new(0,2,0,33) gui6.Size=UDim2.new(0,154,0,13) gui6.Text="Size" gui6.TextColor3=Color3.new(27/255,42/255,53/255)
- gui7=Instance.new("TextButton") gui7.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui7.BorderColor3=Color3.new(27/255,42/255,53/255) gui7.Name="siz_x" gui7.Parent=gui1 gui7.Position=UDim2.new(0,2,0,46) gui7.Size=UDim2.new(0,50,0,14) gui7.Text="x_size" gui7.TextColor3=Color3.new(27/255,42/255,53/255)
- gui8=Instance.new("TextButton") gui8.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui8.BorderColor3=Color3.new(27/255,42/255,53/255) gui8.Name="siz_y" gui8.Parent=gui1 gui8.Position=UDim2.new(0,54,0,46) gui8.Size=UDim2.new(0,50,0,14) gui8.Text="y_size" gui8.TextColor3=Color3.new(27/255,42/255,53/255)
- gui9=Instance.new("TextButton") gui9.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui9.BorderColor3=Color3.new(27/255,42/255,53/255) gui9.Name="siz_z" gui9.Parent=gui1 gui9.Position=UDim2.new(0,106,0,46) gui9.Size=UDim2.new(0,50,0,14) gui9.Text="z_size" gui9.TextColor3=Color3.new(27/255,42/255,53/255)
- gui10=Instance.new("TextLabel") gui10.Active=false gui10.BackgroundColor3=Color3.new(171/255,170/255,173/255) gui10.BackgroundTransparency=1 gui10.BorderColor3=Color3.new(27/255,42/255,53/255) gui10.Name="RotMatrix" gui10.Parent=gui1 gui10.Position=UDim2.new(0,2,0,62) gui10.Size=UDim2.new(0,154,0,13) gui10.Text="Rotation Matrix" gui10.TextColor3=Color3.new(27/255,42/255,53/255)
- gui11=Instance.new("TextButton") gui11.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui11.BorderColor3=Color3.new(27/255,42/255,53/255) gui11.Name="r00" gui11.Parent=gui1 gui11.Position=UDim2.new(0,2,0,75) gui11.Size=UDim2.new(0,50,0,14) gui11.Text="r00" gui11.TextColor3=Color3.new(27/255,42/255,53/255)
- gui12=Instance.new("TextButton") gui12.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui12.BorderColor3=Color3.new(27/255,42/255,53/255) gui12.Name="r01" gui12.Parent=gui1 gui12.Position=UDim2.new(0,54,0,75) gui12.Size=UDim2.new(0,50,0,14) gui12.Text="r01" gui12.TextColor3=Color3.new(27/255,42/255,53/255)
- gui13=Instance.new("TextButton") gui13.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui13.BorderColor3=Color3.new(27/255,42/255,53/255) gui13.Name="r02" gui13.Parent=gui1 gui13.Position=UDim2.new(0,106,0,75) gui13.Size=UDim2.new(0,50,0,14) gui13.Text="r02" gui13.TextColor3=Color3.new(27/255,42/255,53/255)
- gui14=Instance.new("TextButton") gui14.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui14.BorderColor3=Color3.new(27/255,42/255,53/255) gui14.Name="r12" gui14.Parent=gui1 gui14.Position=UDim2.new(0,106,0,91) gui14.Size=UDim2.new(0,50,0,14) gui14.Text="r12" gui14.TextColor3=Color3.new(27/255,42/255,53/255)
- gui15=Instance.new("TextButton") gui15.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui15.BorderColor3=Color3.new(27/255,42/255,53/255) gui15.Name="r10" gui15.Parent=gui1 gui15.Position=UDim2.new(0,2,0,91) gui15.Size=UDim2.new(0,50,0,14) gui15.Text="r10" gui15.TextColor3=Color3.new(27/255,42/255,53/255)
- gui16=Instance.new("TextButton") gui16.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui16.BorderColor3=Color3.new(27/255,42/255,53/255) gui16.Name="r11" gui16.Parent=gui1 gui16.Position=UDim2.new(0,54,0,91) gui16.Size=UDim2.new(0,50,0,14) gui16.Text="r11" gui16.TextColor3=Color3.new(27/255,42/255,53/255)
- gui17=Instance.new("TextButton") gui17.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui17.BorderColor3=Color3.new(27/255,42/255,53/255) gui17.Name="r20" gui17.Parent=gui1 gui17.Position=UDim2.new(0,2,0,107) gui17.Size=UDim2.new(0,50,0,14) gui17.Text="r20" gui17.TextColor3=Color3.new(27/255,42/255,53/255)
- gui18=Instance.new("TextButton") gui18.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui18.BorderColor3=Color3.new(27/255,42/255,53/255) gui18.Name="r21" gui18.Parent=gui1 gui18.Position=UDim2.new(0,54,0,107) gui18.Size=UDim2.new(0,50,0,14) gui18.Text="r21" gui18.TextColor3=Color3.new(27/255,42/255,53/255)
- gui19=Instance.new("TextButton") gui19.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui19.BorderColor3=Color3.new(27/255,42/255,53/255) gui19.Name="r22" gui19.Parent=gui1 gui19.Position=UDim2.new(0,106,0,107) gui19.Size=UDim2.new(0,50,0,14) gui19.Text="r22" gui19.TextColor3=Color3.new(27/255,42/255,53/255)
- gui20=Instance.new("TextLabel") gui20.Active=false gui20.BackgroundColor3=Color3.new(172/255,171/255,174/255) gui20.BackgroundTransparency=1 gui20.BorderColor3=Color3.new(27/255,42/255,53/255) gui20.Name="Rotation" gui20.Parent=gui1 gui20.Position=UDim2.new(0,2,0,123) gui20.Size=UDim2.new(0,154,0,13) gui20.Text="Rotation (Degrees)" gui20.TextColor3=Color3.new(27/255,42/255,53/255)
- gui21=Instance.new("TextButton") gui21.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui21.BorderColor3=Color3.new(27/255,42/255,53/255) gui21.Name="rot_x" gui21.Parent=gui1 gui21.Position=UDim2.new(0,2,0,138) gui21.Size=UDim2.new(0,50,0,14) gui21.Text="x_rotation" gui21.TextColor3=Color3.new(27/255,42/255,53/255)
- gui22=Instance.new("TextButton") gui22.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui22.BorderColor3=Color3.new(27/255,42/255,53/255) gui22.Name="rot_z" gui22.Parent=gui1 gui22.Position=UDim2.new(0,106,0,138) gui22.Size=UDim2.new(0,50,0,14) gui22.Text="z_rotation" gui22.TextColor3=Color3.new(27/255,42/255,53/255)
- gui23=Instance.new("TextButton") gui23.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui23.BorderColor3=Color3.new(27/255,42/255,53/255) gui23.Name="rot_y" gui23.Parent=gui1 gui23.Position=UDim2.new(0,54,0,138) gui23.Size=UDim2.new(0,50,0,14) gui23.Text="y_rotation" gui23.TextColor3=Color3.new(27/255,42/255,53/255)
- gui24=Instance.new("TextButton") gui24.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui24.BorderColor3=Color3.new(27/255,42/255,53/255) gui24.Name="Group Parts" gui24.Parent=gui1 gui24.Position=UDim2.new(0,2,0,154) gui24.Size=UDim2.new(0,75,0,14) gui24.Text="Group Parts" gui24.TextColor3=Color3.new(27/255,42/255,53/255)
- gui25=Instance.new("TextButton") gui25.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui25.BorderColor3=Color3.new(27/255,42/255,53/255) gui25.Name="Ungroup Parts" gui25.Parent=gui1 gui25.Position=UDim2.new(0,79,0,154) gui25.Size=UDim2.new(0,77,0,14) gui25.Text="Ungroup Parts" gui25.TextColor3=Color3.new(27/255,42/255,53/255)
- gui26=Instance.new("TextButton") gui26.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui26.BorderColor3=Color3.new(27/255,42/255,53/255) gui26.Name="Apply" gui26.Parent=gui1 gui26.Position=UDim2.new(0,49,0,202) gui26.Size=UDim2.new(0,107,0,14) gui26.Text="Apply" gui26.TextColor3=Color3.new(27/255,42/255,53/255)
- gui27=Instance.new("TextButton") gui27.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui27.BorderColor3=Color3.new(27/255,42/255,53/255) gui27.Name="Undo" gui27.Parent=gui1 gui27.Position=UDim2.new(0,2,0,170) gui27.Size=UDim2.new(0,75,0,14) gui27.Text="Undo" gui27.TextColor3=Color3.new(27/255,42/255,53/255)
- gui28=Instance.new("TextButton") gui28.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui28.BorderColor3=Color3.new(27/255,42/255,53/255) gui28.Name="Redo" gui28.Parent=gui1 gui28.Position=UDim2.new(0,79,0,170) gui28.Size=UDim2.new(0,77,0,14) gui28.Text="Redo" gui28.TextColor3=Color3.new(27/255,42/255,53/255)
- gui29=Instance.new("TextButton") gui29.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui29.BorderColor3=Color3.new(27/255,42/255,53/255) gui29.Name="Clone" gui29.Parent=gui1 gui29.Position=UDim2.new(0,80,0,186) gui29.Size=UDim2.new(0,76,0,14) gui29.Text="Clone" gui29.TextColor3=Color3.new(27/255,42/255,53/255)
- gui30=Instance.new("TextButton") gui30.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui30.BorderColor3=Color3.new(27/255,42/255,53/255) gui30.Name="Delete" gui30.Parent=gui1 gui30.Position=UDim2.new(0,2,0,186) gui30.Size=UDim2.new(0,76,0,14) gui30.Text="Delete" gui30.TextColor3=Color3.new(27/255,42/255,53/255)
- gui31=Instance.new("TextButton") gui31.BackgroundColor3=Color3.new(255/255,255/255,255/255) gui31.BorderColor3=Color3.new(27/255,42/255,53/255) gui31.Name="Save" gui31.Parent=gui1 gui31.Position=UDim2.new(0,2,0,202) gui31.Size=UDim2.new(0,45,0,14) gui31.Text="Save" gui31.TextColor3=Color3.new(27/255,42/255,53/255)
- gui=Instance.new("ScreenGui"); gui.Name="Build";
- gui1.Parent=obj1
- obj1.Parent=gui
- Active=function(p) if Passive~=nil then Passive(p); end end
- --If you're gonna be making an event get passed through "input",
- --make sure the first value passed is a string identifier of the event.
- --Any other arguments after that are fair game.
- function input(...)
- Active({...});
- end
- --<import>
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Anchor()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "anchor");
- for i,v in pairs(parts) do
- prior[i]={v.Anchored, v.Parent, v.CFrame};
- v.Anchored=FunctionData.Anchor.Mode;
- end
- History.Action("Anchor", parts, prior, FunctionData.Anchor.Mode);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Anchor = FunctionData.Anchor or {};
- FunctionData.Anchor.Mode = FunctionData.Anchor.Mode or true;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(212/255,244/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Anchor" obj40.Position=UDim2.new(0,243,1,-40) obj40.Size=UDim2.new(0,84,0,40)
- obj41=Instance.new("TextButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="true" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,17) obj41.Text="Anchor Parts" obj41.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="false" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,21) obj42.Size=UDim2.new(0,80,0,17) obj42.Text="Unanchor Parts" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- obj41.MouseButton1Down:connect(function()
- FunctionData.Anchor.Mode = true;
- obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- obj42.MouseButton1Down:connect(function()
- FunctionData.Anchor.Mode = false;
- obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.CanCollide()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "cancollide");
- for i,v in pairs(parts) do
- prior[i]={v.CanCollide, v.Parent, v.CFrame};
- v.CanCollide=FunctionData.CanCollide.Mode;
- end
- History.Action("CanCollide", parts, prior, FunctionData.CanCollide.Mode);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.CanCollide = FunctionData.CanCollide or {};
- FunctionData.CanCollide.Mode = FunctionData.CanCollide.Mode or true;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(212/255,244/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="CanCollide" obj40.Position=UDim2.new(0,243,1,-40) obj40.Size=UDim2.new(0,84,0,40)
- obj41=Instance.new("TextButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="false" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,17) obj41.Text="CanCollide: false" obj41.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="true" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,21) obj42.Size=UDim2.new(0,80,0,17) obj42.Text="CanCollide: true" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- obj41.MouseButton1Down:connect(function()
- FunctionData.CanCollide.Mode = false;
- obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- obj42.MouseButton1Down:connect(function()
- FunctionData.CanCollide.Mode = true;
- obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Color()
- mouse_colorCopy = nil;
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- if obj40~=nil then obj40.Parent=nil; end
- if sb~=nil then sb.Parent=nil; end
- return;
- elseif c=="Button1Down" then
- if sb.Visible then
- sb.Visible=false;
- for i,v in pairs(FunctionData.Color.ColorList) do
- if v==p[2].Target.BrickColor.Name then
- FunctionData.Color.Choice = i;
- RefreshColors();
- end
- end
- else
- Passive(p);
- end
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Move" then
- mouse_colorCopy = mouse_colorCopy or p[2];
- if sb.Visible then
- sb.Adornee=p[2].Target;
- end
- local obj45=obj45;
- Spawn(function()
- mouse_over=mouse_over+1;
- obj45.BackgroundTransparency=1;
- obj45.TextTransparency=1;
- if p[2].Target~=nil then
- local mo=mouse_over;
- if mo==mouse_over and Options.ToolTipText=="on" then
- wait(.75)
- end
- if mo==mouse_over then
- obj45.Text=p[2].Target.BrickColor.Name;
- obj45.Position=UDim2.new(0,p[2].X-obj40.AbsolutePosition.x,0,p[2].Y-obj40.AbsolutePosition.y-obj45.AbsoluteSize.y);
- if Options.ToolTipText=="immediate" then
- obj45.BackgroundTransparency=0;
- obj45.TextTransparency=0;
- end
- end
- if Options.ToolTipText=="on" then
- for transparency=1,0,-.05 do
- if mo==mouse_over then
- obj45.BackgroundTransparency=transparency;
- obj45.TextTransparency=transparency;
- wait();
- end
- end
- if mo==mouse_over then
- obj45.BackgroundTransparency=0;
- obj45.TextTransparency=0;
- end
- end
- end
- end)
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- new={};
- parts=HasPermission(GetParts(Selection.Get()), "color");
- for i,v in pairs(parts) do
- prior[i]=v.BrickColor;
- if FunctionData.Color.Choice<=143 then
- v.BrickColor=BrickColor.new(FunctionData.Color.ColorList[FunctionData.Color.Choice or 10])
- elseif FunctionData.Color.Choice==144 then
- --painting a brick while the eyedropper is selected? Using the current mouseOver would be nice...
- if mouse_colorCopy~=nil then
- if mouse_colorCopy.Target then
- v.BrickColor=mouse_colorCopy.Target.BrickColor;
- end
- end
- elseif FunctionData.Color.Choice==145 then
- v.BrickColor=BrickColor.new(FunctionData.Color.ColorList[math.random(143)]);
- end
- new[i]=v.BrickColor;
- end
- History.Action("Color", parts, prior, new);
- return;
- else
- Passive(p);
- end
- end
- function RefreshColors()
- for i=1,145 do
- if i~=FunctionData.Color.Choice then
- obj41:findFirstChild(i).BorderColor3=Color3.new(0,0,0);
- else
- obj41:findFirstChild(FunctionData.Color.Choice).BorderColor3=Options.SelectedColor;
- end
- end
- end
- FunctionData.Color = FunctionData.Color or {};
- FunctionData.Color.ColorList=FunctionData.Color.ColorList or {"Institutional white","White","Phosph. White","Transparent","Light stone grey","Mid gray","Light grey","Tr. Brown","Light grey metallic","Medium stone grey","Silver","Grey","Silver flip/flop","Gun metallic","Dark grey","Dark stone grey","Dark grey metallic","Black metallic","Black","Really black","Light red","Pastel orange","Tr. Flu. Reddish orange","Medium red","Tr. Red","Bright red","Really red","Dusty Rose","Dark red","Red flip/flop","Sand red","Light orange","Medium orange","Warm yellowish orange","Bright orange","Deep orange","Neon orange","Flame reddish orange","CGA brown","Dark orange","Br. yellowish orange","Br. reddish orange","Med. yellowish orange","Curry","Dark Curry","Light orange brown","Pastel brown","Yellow flip/flop","Light brick yellow","Brown","Nougat","Dark nougat","Earth orange","Reddish brown","Rust","Gold","Earth yellow","Brick yellow","Lig. Yellowich orange","Pastel yellow","Light yellow","Cool yellow","Tr. Yellow","Tr. Flu. Green","Tr. Flu. Yellow","Flame yellowish orange","Fire Yellow","Bright yellow","New Yeller","Sand yellow","Sand yellow metallic","Lig. yellowish green","Med. yellowish green","Olive","Grime","Faded green","Neon green","Light green (Mint)","Br. yellowish green","Lime green","Bright green","Camo","Dark green","Earth green","Pastel green","Medium green","Sand green","Tr. Green","Lemon metalic","Light blue","Tr. Lg blue","Tr. Flu. Blue","Light bluish green","Light Royal blue","Pastel light blue","Light bluish violet","Pastel blue-green","Pastel Blue","Turquoise","Med. bluish green","Medium blue","Dove blue","Tr. Blue","Toothpaste","Teal","Cyan","Bright bluish green","Bright blue","Really blue","Navy blue","Earth blue","Medium Royal blue","Medium bluish violet","Royal blue","Bright bluish violet","Deep blue","Dark Royal blue","Sand blue metallic","Sand blue","Tr. Bright bluish violet","Pastel violet","Light lilac","Alder","Lilac","Reddish lilac","Lavender","Royal purple","Bright violet","Tr. Medi. reddish violet","Light reddish violet","Light purple","Tr. Flu. Red","Light pink","Pink","Hot pink","Magenta","Bright purple","Med. reddish violet","Bright reddish lilac","Bright reddish violet","Medium lilac","Sand violet metallic","Sand violet","Eyedropper","Random Color"}
- FunctionData.Color.Choice = FunctionData.Color.Choice or 10;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(213/255,245/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Color" obj40.Position=UDim2.new(0,243,1,-200) obj40.Size=UDim2.new(0,583,0,103)
- obj41=Instance.new("Frame") obj41.BackgroundColor3=Color3.new(255/255,176/255,0/255) obj41.BackgroundTransparency=1 obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="Palette" obj41.Parent=obj40 obj41.Position=UDim2.new(0,-3,0,-3) obj41.Size=UDim2.new(0,590,0,110)
- obj42=Instance.new("ImageButton") obj42.BackgroundColor3=Color3.new(180/255,179/255,182/255) obj42.Image="http://www.roblox.com/asset/?id=34254577" obj42.Name="145" obj42.Parent=obj41 obj42.Position=UDim2.new(0,565,0,85) obj42.Size=UDim2.new(0,19,0,19)
- obj43=Instance.new("ImageButton") obj43.BackgroundColor3=Color3.new(179/255,178/255,181/255) obj43.Image="http://www.roblox.com/asset/?id=34254562" obj43.Name="144" obj43.Parent=obj41 obj43.Position=UDim2.new(0,545,0,85) obj43.Size=UDim2.new(0,19,0,19)
- obj45=Instance.new("TextLabel"); obj45.BackgroundColor3=Options.ToolTipColor; obj45.Size=UDim2.new(0, 140, 0, 30); obj45.TextWrap=true; obj45.BackgroundTransparency=1; obj45.TextTransparency=1; obj45.Parent=obj40
- obj42.MouseButton1Down:connect(function()
- FunctionData.Color.Choice=tonumber(obj42.Name);
- RefreshColors();
- end)
- obj43.MouseButton1Down:connect(function()
- FunctionData.Color.Choice=tonumber(obj43.Name);
- sb.Visible=true;
- RefreshColors();
- end)
- sb=Instance.new("SelectionBox");
- sb.Name="ColorEyedropper";
- sb.Color=Options.ActiveSelectionBoxColor;
- sb.Visible=false;
- sb.Parent=obj1;
- mouse_over=0;
- for i=0,142,1 do
- local obj44=Instance.new("TextButton")
- obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255)
- obj44.BorderColor3=Color3.new(8/255,8/255,8/255)
- obj44.Name=tostring(i+1)
- obj44.Position=UDim2.new(0,5+(i%29)*20,0,5+(math.floor(i/29))*20)
- obj44.Size=UDim2.new(0,19,0,19)
- obj44.Text=""
- obj44.BackgroundColor3=BrickColor.new(FunctionData.Color.ColorList[i+1]).Color
- obj44.MouseButton1Down:connect(function()
- FunctionData.Color.Choice=tonumber(obj44.Name);
- RefreshColors()
- end)
- obj44.MouseMoved:connect(function(x, y)
- mouse_over=mouse_over+1;
- obj45.BackgroundTransparency=1;
- obj45.TextTransparency=1;
- local mo=mouse_over;
- if Options.ToolTipText=="on" then
- wait(.75)
- end
- if mo==mouse_over then
- obj45.Text=FunctionData.Color.ColorList[tonumber(obj44.Name)];
- obj45.Position=UDim2.new(0,x-obj40.AbsolutePosition.x,0,y-obj40.AbsolutePosition.y-obj45.AbsoluteSize.y);
- if Options.ToolTipText=="immediate" then
- obj45.BackgroundTransparency=0;
- obj45.TextTransparency=0;
- end
- end
- if Options.ToolTipText=="on" then
- for transparency=1,0,-.05 do
- if mo==mouse_over then
- obj45.BackgroundTransparency=transparency;
- obj45.TextTransparency=transparency;
- wait();
- end
- end
- if mo==mouse_over then
- obj45.BackgroundTransparency=0;
- obj45.TextTransparency=0;
- end
- end
- end)
- obj44.Parent=obj41
- end
- obj40.Parent=obj1;
- RefreshColors();
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Elasticity()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- FunctionData.Elasticity.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- TB.remove(obj41);
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- FunctionData.Elasticity.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "elasticity");
- for i,v in pairs(parts) do
- prior[i]=v.Elasticity;
- v.Elasticity=FunctionData.Elasticity.value;
- end
- History.Action("Elasticity", parts, prior, FunctionData.Elasticity.value);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Elasticity = FunctionData.Elasticity or {};
- FunctionData.Elasticity.value = FunctionData.Elasticity.value or .5;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(214/255,246/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Elasticity" obj40.Position=UDim2.new(0,243,1,-22) obj40.Size=UDim2.new(0,84,0,22)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="tBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="Transparency" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(227/255,227/255,227/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="tButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text=".5" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text=FunctionData.Elasticity.value;
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.FormFactor()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- after={};
- parts=HasPermission(GetParts(Selection.Get()), "formfactor");
- for i,v in pairs(parts) do
- prior[i]=v.FormFactor;
- local cf=v.CFrame;
- v.FormFactor=FunctionData.FormFactor.Mode;
- v.CFrame=cf;
- after[i]=v.FormFactor;
- end
- History.Action("FormFactor", parts, prior, after);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.FormFactor = FunctionData.FormFactor or {};
- FunctionData.FormFactor.Mode = FunctionData.FormFactor.Mode or Enum.FormFactor.Custom;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(214/255,246/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="FormFactor" obj40.Position=UDim2.new(0,243,1,-82) obj40.Size=UDim2.new(0,84,0,82)
- obj41=Instance.new("TextButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="Plate" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="Plate" obj41.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="Symmetric" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,22) obj42.Size=UDim2.new(0,80,0,18) obj42.Text="Symmetric" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="Brick" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,42) obj43.Size=UDim2.new(0,80,0,18) obj43.Text="Brick" obj43.TextColor3=Color3.new(27/255,42/255,53/255)
- obj44=Instance.new("TextButton") obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Name="Custom" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,62) obj44.Size=UDim2.new(0,80,0,18) obj44.Text="Custom" obj44.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- function RefreshButtons()
- obj41.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Plate and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Symmetric and Options.SelectedColor or Options.ButtonColor;
- obj43.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Brick and Options.SelectedColor or Options.ButtonColor;
- obj44.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Custom and Options.SelectedColor or Options.ButtonColor;
- end
- obj41.MouseButton1Down:connect(function()
- FunctionData.FormFactor.Mode=Enum.FormFactor.Plate;
- RefreshButtons();
- end)
- obj42.MouseButton1Down:connect(function()
- FunctionData.FormFactor.Mode=Enum.FormFactor.Symmetric;
- RefreshButtons();
- end)
- obj43.MouseButton1Down:connect(function()
- FunctionData.FormFactor.Mode=Enum.FormFactor.Brick;
- RefreshButtons();
- end)
- obj44.MouseButton1Down:connect(function()
- FunctionData.FormFactor.Mode=Enum.FormFactor.Custom;
- RefreshButtons();
- end)
- RefreshButtons();
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Friction()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- FunctionData.Friction.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- TB.remove(obj41);
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- FunctionData.Friction.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "friction");
- for i,v in pairs(parts) do
- prior[i]=v.Friction;
- v.Friction=FunctionData.Friction.value;
- end
- History.Action("Friction", parts, prior, FunctionData.Friction.value);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Friction = FunctionData.Friction or {};
- FunctionData.Friction.value = FunctionData.Friction.value or .5;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(214/255,246/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Friction" obj40.Position=UDim2.new(0,243,1,-22) obj40.Size=UDim2.new(0,84,0,22)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="tBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="Transparency" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(227/255,227/255,227/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="tButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text=".5" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text=FunctionData.Friction.value;
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- end
- History={Done={}, Undone={}}
- History.Action=function(...)
- History.Done[#History.Done+1]={...};
- History.Undone={};
- end;
- History.Prep=function(...)
- History.Undone[#History.Undone+1]={...};
- end;
- History.Undo=function()
- if #History.Done>0 then
- local p=History.Done[#History.Done];
- if p[1]=="Move" then
- for i=1,#p[2] do
- p[2][i].CFrame=p[3][i];
- end
- elseif p[1]=="Clone" then
- for i,v in pairs(p[2]) do
- v.Parent=nil;
- if Selection.Check(v) then
- Selection.Remove(v);
- end
- end
- elseif p[1]=="Delete" then
- for i,v in pairs(p[2]) do
- v.Parent=p[3][i];
- Selection.Add(v);
- end
- elseif p[1]=="Resize" then
- for i,v in pairs(p[2]) do
- local cf=v.CFrame;
- v.Size=p[3][i];
- v.CFrame=cf;
- end
- elseif p[1]=="Move+Resize" then
- v=p[2];
- v.Size=p[5];
- v.CFrame=p[3];
- elseif p[1]=="Rotate" then
- for i,v in pairs(p[2]) do
- v.CFrame = p[3][i];
- end
- elseif p[1]=="Lock" then
- for i,v in pairs(p[2]) do
- v.Locked = p[3][i];
- end
- elseif p[1]=="Color" then
- for i,v in pairs(p[2]) do
- v.BrickColor = p[3][i];
- end
- elseif p[1]=="Material" then
- for i,v in pairs(p[2]) do
- v.Material = p[3][i];
- end
- elseif p[1]=="Transparency" then
- for i,v in pairs(p[2]) do
- v.Transparency=p[3][i];
- end
- elseif p[1]=="Reflectance" then
- for i,v in pairs(p[2]) do
- v.Reflectance=p[3][i];
- end
- elseif p[1]=="Anchor" then
- for i,v in pairs(p[2]) do
- v.Anchored = p[3][i][1];
- v.Parent=p[3][i][2];
- v.CFrame=p[3][i][3];
- end
- elseif p[1]=="CanCollide" then
- for i,v in pairs(p[2]) do
- v.CanCollide = p[3][i][1];
- v.Parent=p[3][i][2];
- v.CFrame=p[3][i][3];
- end
- elseif p[1]=="FormFactor" then
- for i,v in pairs(p[2]) do
- local cf=v.CFrame;
- v.FormFactor=p[3][i];
- v.CFrame=cf;
- end
- elseif p[1]=="Shape" then
- for i,v in pairs(p[2]) do
- if p[4]~=nil and p[4][i]~=nil and p[4][i][1]~=nil then
- v.Parent=p[4][i][1].Parent;
- p[4][i][1].Parent=nil;
- if Selection.Check(p[4][i][1]) then
- Selection.Add(v);
- Selection.Remove(p[4][i][1]);
- end
- elseif p[3]~=nil and p[3][i]~=nil and p[3][i][4]~=nil and p[3][i][3]~=nil and p[3][i][2]~=nil then
- v.Shape=p[3][i][4];
- v.Size=p[3][i][3];
- v.CFrame=p[3][i][2];
- end
- end
- elseif p[1]=="Surface" then
- for i,v in pairs(p[2]) do
- if p[3]==Enum.NormalId.Left then v.LeftSurface=p[4][i];
- elseif p[3]==Enum.NormalId.Right then v.RightSurface=p[4][i];
- elseif p[3]==Enum.NormalId.Top then v.TopSurface=p[4][i];
- elseif p[3]==Enum.NormalId.Bottom then v.BottomSurface=p[4][i];
- elseif p[3]==Enum.NormalId.Front then v.FrontSurface=p[4][i];
- elseif p[3]==Enum.NormalId.Back then v.BackSurface=p[4][i];
- end
- end
- elseif p[1]=="Velocity" then
- for i,v in pairs(p[2]) do
- v.Velocity=p[3][i];
- end
- end
- History.Undone[#History.Undone+1]=History.Done[#History.Done];
- History.Done[#History.Done]=nil;
- end
- end
- History.Redo=function()
- --handle History.Undone
- if #History.Undone>0 then
- local p=History.Undone[#History.Undone];
- if p[1]=="Move" then
- for i,v in pairs(p[2]) do
- p[2][i].CFrame=p[4][i];
- end
- elseif p[1]=="Clone" then
- for i=1,#p[2] do
- p[2][i].Parent=workspace;
- for i,v in pairs(p[3]) do
- if v[1]==p[2][i] or v[1]:IsDescendantOf(p[2][i]) then
- v[1].CFrame=v[2];
- end
- end
- end
- elseif p[1]=="Delete" then
- for i,v in pairs(p[2]) do
- Selection.Remove(v);
- v.Parent=nil;
- end
- elseif p[1]=="Resize" then
- for i,v in pairs(p[2]) do
- local cf=v.CFrame;
- v.Size=p[4][i];
- v.CFrame=cf;
- end
- elseif p[1]=="Move+Resize" then
- v=p[2];
- v.Size=p[6];
- v.CFrame=p[4];
- elseif p[1]=="Rotate" then
- for i,v in pairs(p[2]) do
- v.CFrame = p[4][i];
- end
- elseif p[1]=="Lock" then
- for i,v in pairs(p[2]) do
- v.Locked = p[4];
- end
- elseif p[1]=="Color" then
- for i,v in pairs(p[2]) do
- v.BrickColor = p[4][i];
- end
- elseif p[1]=="Material" then
- for i,v in pairs(p[2]) do
- v.Material = p[4];
- end
- elseif p[1]=="Transparency" then
- for i,v in pairs(p[2]) do
- v.Transparency=p[4][i];
- end
- elseif p[1]=="Reflectance" then
- for i,v in pairs(p[2]) do
- v.Reflectance=p[4][i];
- end
- elseif p[1]=="Anchor" then
- for i,v in pairs(p[2]) do
- v.Anchored = p[4];
- end
- elseif p[1]=="CanCollide" then
- for i,v in pairs(p[2]) do
- v.CanCollide = p[4];
- end
- elseif p[1]=="FormFactor" then
- for i,v in pairs(p[2]) do
- local cf=v.CFrame;
- v.FormFactor=p[4][i];
- v.CFrame=cf;
- end
- elseif p[1]=="Shape" then
- for i,v in pairs(p[2]) do
- if p[4][i][1]~=nil then
- p[4][i][1].Parent=v.Parent;
- v.Parent=nil;
- if Selection.Check(p[4][i][1]) then
- Selection.Add(v);
- Selection.Remove(p[4][i][1]);
- end
- else
- v.Shape=p[4][i][2];
- v.Size=p[3][i][3];
- v.CFrame=p[3][i][2];
- end
- end
- elseif p[1]=="Surface" then
- for i,v in pairs(p[2]) do
- if p[3]==Enum.NormalId.Left then v.LeftSurface=p[5];
- elseif p[3]==Enum.NormalId.Right then v.RightSurface=p[5];
- elseif p[3]==Enum.NormalId.Top then v.TopSurface=p[5];
- elseif p[3]==Enum.NormalId.Bottom then v.BottomSurface=p[5];
- elseif p[3]==Enum.NormalId.Front then v.FrontSurface=p[5];
- elseif p[3]==Enum.NormalId.Back then v.BackSurface=p[5];
- end
- end
- elseif p[1]=="Velocity" then
- for i,v in pairs(p[2]) do
- v.Velocity=p[4];
- end
- end
- History.Done[#History.Done+1]=History.Undone[#History.Undone];
- History.Undone[#History.Undone]=nil;
- end
- end
- --[[ Hook Up Guis ]]
- PaletteMode=1;
- PaletteImages={
- {36663907,36662758,36662760,36662767,36662771},
- {0,36681404,36681442,36681517,36681469},
- {0,36681389,36681397,36681413,36681490},
- {0,36681506,36681529,36681480,36681419},
- {0,36681407,36681526,36681456,36681429},
- };
- PaletteFunctions = PaletteFunctions or {};
- PaletteFunctions={
- Move=PaletteFunctions.Move or (function() end),
- Resize=PaletteFunctions.Resize or (function() end),
- Rotate=PaletteFunctions.Rotate or (function() end),
- Lock=PaletteFunctions.Lock or (function() end),
- Color=PaletteFunctions.Color or (function() end),
- Material=PaletteFunctions.Material or (function() end),
- Transparency=PaletteFunctions.Transparency or (function() end),
- Reflectance=PaletteFunctions.Reflectance or (function() end),
- Anchor=PaletteFunctions.Anchor or (function() end),
- CanCollide=PaletteFunctions.CanCollide or (function() end),
- FormFactor=PaletteFunctions.FormFactor or (function() end),
- Shape=PaletteFunctions.Shape or (function() end),
- Surface=PaletteFunctions.Surface or (function() end),
- Velocity=PaletteFunctions.Velocity or (function() end),
- RotVelocity=PaletteFunctions.RotVelocity or (function() end),
- Friction=PaletteFunctions.Friction or (function() end),
- Elasticity=PaletteFunctions.Elasticity or (function() end),
- Utilities=PaletteFunctions.Utilities or (function() end),
- Options=PaletteFunctions.Options or (function() end),
- Help=PaletteFunctions.Help or (function() end),
- };
- FunctionData={};
- function RefreshPalette()
- obj3.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][2]);
- obj4.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][4]);
- obj5.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][5]);
- obj6.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][3]);
- end
- function ActivateFunction(index)
- input("Unload");
- if PaletteMode==1 and index==1 then
- PaletteFunctions.Move();
- elseif PaletteMode==1 and index==2 then
- PaletteFunctions.Resize();
- elseif PaletteMode==1 and index==3 then
- PaletteFunctions.Rotate();
- elseif PaletteMode==1 and index==4 then
- PaletteFunctions.Lock();
- elseif PaletteMode==2 and index==1 then
- PaletteFunctions.Color();
- elseif PaletteMode==2 and index==2 then
- PaletteFunctions.Material();
- elseif PaletteMode==2 and index==3 then
- PaletteFunctions.Transparency();
- elseif PaletteMode==2 and index==4 then
- PaletteFunctions.Reflectance();
- elseif PaletteMode==3 and index==1 then
- PaletteFunctions.Anchor();
- elseif PaletteMode==3 and index==2 then
- PaletteFunctions.CanCollide();
- elseif PaletteMode==3 and index==3 then
- PaletteFunctions.FormFactor();
- elseif PaletteMode==3 and index==4 then
- PaletteFunctions.Shape();
- elseif PaletteMode==4 and index==1 then
- PaletteFunctions.Surface();
- elseif PaletteMode==4 and index==2 then
- PaletteFunctions.Velocity();
- elseif PaletteMode==4 and index==3 then
- PaletteFunctions.RotVelocity();
- elseif PaletteMode==4 and index==4 then
- PaletteFunctions.Friction();
- elseif PaletteMode==5 and index==1 then
- PaletteFunctions.Elasticity();
- elseif PaletteMode==5 and index==2 then
- PaletteFunctions.Utilities();
- elseif PaletteMode==5 and index==3 then
- PaletteFunctions.Options();
- elseif PaletteMode==5 and index==4 then
- PaletteFunctions.Help();
- end
- end
- obj7.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[1][1]);
- obj8.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[2][1]);
- obj9.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[3][1]);
- obj10.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[4][1]);
- obj11.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[5][1]);
- function HitButton(obj)
- if obj==obj3 then
- ActivateFunction(1);
- elseif obj==obj4 then
- ActivateFunction(3);
- elseif obj==obj5 then
- ActivateFunction(4);
- elseif obj==obj6 then
- ActivateFunction(2);
- elseif obj==obj7 then
- PaletteMode=1;
- RefreshPalette();
- elseif obj==obj8 then
- PaletteMode=2;
- RefreshPalette();
- elseif obj==obj9 then
- PaletteMode=3;
- RefreshPalette();
- elseif obj==obj10 then
- PaletteMode=4;
- RefreshPalette();
- elseif obj==obj11 then
- PaletteMode=5;
- RefreshPalette();
- elseif obj==gui24 then
- input("Group");
- elseif obj==gui25 then
- input("Ungroup");
- elseif obj==gui26 then
- input("Apply");
- elseif obj==gui27 then
- input("Undo");
- elseif obj==gui28 then
- input("Redo");
- elseif obj==gui29 then
- input("Clone");
- elseif obj==gui30 then
- input("Delete");
- elseif obj==gui31 then
- input("Save");
- end
- end
- obj3.MouseButton1Down:connect(function() HitButton(obj3); end);
- obj4.MouseButton1Down:connect(function() HitButton(obj4); end);
- obj5.MouseButton1Down:connect(function() HitButton(obj5); end);
- obj6.MouseButton1Down:connect(function() HitButton(obj6); end);
- obj7.MouseButton1Down:connect(function() HitButton(obj7); end);
- obj8.MouseButton1Down:connect(function() HitButton(obj8); end);
- obj9.MouseButton1Down:connect(function() HitButton(obj9); end);
- obj10.MouseButton1Down:connect(function() HitButton(obj10); end);
- obj11.MouseButton1Down:connect(function() HitButton(obj11); end);
- gui24.MouseButton1Down:connect(function() HitButton(gui24); end);
- gui25.MouseButton1Down:connect(function() HitButton(gui25); end);
- gui26.MouseButton1Down:connect(function() HitButton(gui26); end);
- gui27.MouseButton1Down:connect(function() HitButton(gui27); end);
- gui28.MouseButton1Down:connect(function() HitButton(gui28); end);
- gui29.MouseButton1Down:connect(function() HitButton(gui29); end);
- gui30.MouseButton1Down:connect(function() HitButton(gui30); end);
- gui31.MouseButton1Down:connect(function() HitButton(gui31); end);
- RefreshPalette();
- --[[gui_drag=nil;
- dragger_gui.BackgroundTransparency=.5;
- dragger_gui.Parent=obj1;
- GuiDrag={
- function Down(gui)
- dragger_gui.Size=gui.Size;
- dragger_gui.BackgroundColor3=gui.BackgroundColor3;
- end,
- }
- gui2.MouseButton1Down:connect(function() gui_drag=gui2; end)
- gui4.MouseButton1Down:connect(function() gui_drag=gui2; end)
- gui5.MouseButton1Down:connect(function() gui_drag=gui2; end)
- ]]
- --[[
- void keys.down(k as Integer)
- void keys.up(k as Integer)
- bool keys.check(k as Integer)
- ]]
- keys={
- down=function(k)
- table.insert(keys.list,k);
- end,
- up=function(k)
- for i=#keys.list,1,-1 do
- if keys.list[i]==k then
- table.remove(keys.list,i);
- end
- end
- end,
- check=function(k)
- for i,v in pairs(keys.list) do
- if k==v then
- return true;
- end
- end
- return false;
- end,
- list={}
- }
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Lock()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "lock");
- for i,v in pairs(parts) do
- prior[i]=v.Locked;
- v.Locked=FunctionData.Lock.Mode;
- end
- History.Action("Lock", parts, prior, FunctionData.Lock.Mode);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Lock = FunctionData.Lock or {};
- FunctionData.Lock.Mode = FunctionData.Lock.Mode or false;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(211/255,243/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Lock" obj40.Position=UDim2.new(0,243,1,-40) obj40.Size=UDim2.new(0,84,0,40)
- obj41=Instance.new("TextButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="true" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,17) obj41.Text="Lock Selection" obj41.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="false" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,21) obj42.Size=UDim2.new(0,80,0,17) obj42.Text="Unlock Selection" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- obj41.MouseButton1Down:connect(function()
- FunctionData.Lock.Mode = true;
- obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- obj42.MouseButton1Down:connect(function()
- FunctionData.Lock.Mode = false;
- obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
- end)
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Material()
- mouse_over=0;
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- elseif c=="Move" then
- local obj50=obj50;
- Spawn(function()
- mouse_over=mouse_over+1;
- obj50.BackgroundTransparency=1;
- obj50.TextTransparency=1;
- if p[2].Target~=nil then
- local mo=mouse_over;
- if mo==mouse_over and Options.ToolTipText=="on" then
- wait(.75)
- end
- if mo==mouse_over then
- obj50.Text=string.sub(tostring(p[2].Target.Material), 15);
- obj50.Position=UDim2.new(0,p[2].X-obj40.AbsolutePosition.x,0,p[2].Y-obj40.AbsolutePosition.y-obj50.AbsoluteSize.y);
- if Options.ToolTipText=="immediate" then
- obj50.BackgroundTransparency=0;
- obj50.TextTransparency=0;
- end
- end
- if Options.ToolTipText=="on" then
- for transparency=1,0,-.05 do
- if mo==mouse_over then
- obj50.BackgroundTransparency=transparency;
- obj50.TextTransparency=transparency;
- wait();
- end
- end
- if mo==mouse_over then
- obj50.BackgroundTransparency=0;
- obj50.TextTransparency=0;
- end
- end
- end
- end)
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- new=nil;
- parts=HasPermission(GetParts(Selection.Get()), "material");
- for i,v in pairs(parts) do
- prior[i]=v.Material;
- v.Material = FunctionData.Material.Choice;
- end
- History.Action("Material", parts, prior, FunctionData.Material.Choice);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Material = FunctionData.Material or {};
- FunctionData.Material.Choice = FunctionData.Material.Choice or Enum.Material.Plastic;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(213/255,245/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Material" obj40.Position=UDim2.new(0,243,1,-200) obj40.Size=UDim2.new(0,344,0,40)
- obj41=Instance.new("ImageButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Image="http://www.roblox.com/Asset/?ID=16170001" obj41.Name="Concrete" obj41.Parent=obj40 obj41.Position=UDim2.new(0,192,0,2) obj41.Size=UDim2.new(0,36,0,36)
- obj42=Instance.new("ImageButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Image="http://www.roblox.com/Asset/?ID=16169978" obj42.Name="CorrodedMetal" obj42.Parent=obj40 obj42.Position=UDim2.new(0,116,0,2) obj42.Size=UDim2.new(0,36,0,36)
- obj43=Instance.new("ImageButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Image="http://www.roblox.com/Asset/?ID=16169998" obj43.Name="DiamondPlate" obj43.Parent=obj40 obj43.Position=UDim2.new(0,230,0,2) obj43.Size=UDim2.new(0,36,0,36)
- obj44=Instance.new("ImageButton") obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Image="http://www.roblox.com/Asset/?ID=16169991" obj44.Name="Foil" obj44.Parent=obj40 obj44.Position=UDim2.new(0,78,0,2) obj44.Size=UDim2.new(0,36,0,36)
- obj45=Instance.new("ImageButton") obj45.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Image="http://www.roblox.com/Asset/?ID=16169988" obj45.Name="Grass" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,2) obj45.Size=UDim2.new(0,36,0,36)
- obj46=Instance.new("ImageButton") obj46.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Image="http://www.roblox.com/Asset/?ID=16169985" obj46.Name="Ice" obj46.Parent=obj40 obj46.Position=UDim2.new(0,306,0,2) obj46.Size=UDim2.new(0,36,0,36)
- obj47=Instance.new("ImageButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Image="http://www.roblox.com/Asset/?ID=16169981" obj47.Name="Plastic" obj47.Parent=obj40 obj47.Position=UDim2.new(0,40,0,2) obj47.Size=UDim2.new(0,36,0,36)
- obj48=Instance.new("ImageButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Image="http://www.roblox.com/Asset/?ID=16169975" obj48.Name="Slate" obj48.Parent=obj40 obj48.Position=UDim2.new(0,268,0,2) obj48.Size=UDim2.new(0,36,0,36)
- obj49=Instance.new("ImageButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Image="http://www.roblox.com/Asset/?ID=16169971" obj49.Name="Wood" obj49.Parent=obj40 obj49.Position=UDim2.new(0,154,0,2) obj49.Size=UDim2.new(0,36,0,36)
- obj40.Parent=obj1;
- obj50=Instance.new("TextLabel"); obj50.BackgroundColor3=Options.ToolTipColor; obj50.Size=UDim2.new(0, 140, 0, 30); obj50.TextWrap=true; obj50.BackgroundTransparency=1; obj50.TextTransparency=1; obj50.Parent=obj40
- function RefreshMaterials()
- for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48, obj49}) do
- if Enum.Material[v.Name] == FunctionData.Material.Choice then
- v.BorderColor3=Options.SelectedColor;
- else
- v.BorderColor3=Color3.new(0,0,0);
- end
- end
- end
- for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48, obj49}) do
- v.MouseButton1Down:connect(function()
- FunctionData.Material.Choice = Enum.Material[v.Name];
- RefreshMaterials();
- end)
- v.MouseMoved:connect(function(x,y)
- local obj50=obj50;
- mouse_over=mouse_over+1;
- obj50.BackgroundTransparency=1;
- obj50.TextTransparency=1;
- if true then
- local mo=mouse_over;
- if mo==mouse_over and Options.ToolTipText=="on" then
- wait(.75)
- end
- if mo==mouse_over then
- obj50.Text=v.Name;
- obj50.Position=UDim2.new(0,x-obj40.AbsolutePosition.x,0,y-obj40.AbsolutePosition.y-obj50.AbsoluteSize.y);
- if Options.ToolTipText=="immediate" then
- obj50.BackgroundTransparency=0;
- obj50.TextTransparency=0;
- end
- end
- if Options.ToolTipText=="on" then
- for transparency=1,0,-.05 do
- if mo==mouse_over then
- obj50.BackgroundTransparency=transparency;
- obj50.TextTransparency=transparency;
- wait();
- end
- end
- if mo==mouse_over then
- obj50.BackgroundTransparency=0;
- obj50.TextTransparency=0;
- end
- end
- end
- end)
- end
- end
- function PaletteFunctions.Move()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- FunctionData.Move.x = tonumber(obj42.Text) or 0;
- FunctionData.Move.y = tonumber(obj44.Text) or 0;
- FunctionData.Move.z = tonumber(obj46.Text) or 0;
- TB.remove(obj41);
- TB.remove(obj43);
- TB.remove(obj45);
- aabb.Parent=nil;
- handles.Parent=nil;
- sb.Parent=nil;
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- Spawn(function()
- local t = tab_index;
- wait(Options.RepeatDelay);
- while keys.check(9) and t==tab_index do
- HitButton(gui26);
- wait(Options.RepeatRate);
- end
- end);
- end
- Passive(p);
- UpdateHandles();
- elseif c=="KeyUp" then
- if string.byte(p[3])==9 then
- tab_index = tab_index + 1;
- end
- Passive(p);
- elseif c=="Move" then
- if pending_target then
- sb.Adornee=p[2].Target;
- else
- Passive(p);
- end
- elseif c=="Button1Down" then
- if pending_target then
- FunctionData.Move.TargetAxis = p[2].Target;
- pending_target=false;
- if pending_target then
- obj51.Text = "Pending Selection...";
- elseif FunctionData.Move.TargetAxis then
- obj51.Text = "Axes Alignment Chosen";
- else
- obj51.Text = "No Reference Part";
- end
- sb.Visible=false;
- else
- aabb.Parent=nil;
- handles.Visible=false;
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- Passive(p);
- UpdateHandles();
- end
- elseif c=="Apply" then
- FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- prior={};
- after={};
- p=HasPermission(GetParts(Selection.Get()), "move");
- if FunctionData.Move.TargetAxis then
- for i,v in pairs(p) do
- prior[i]=v.CFrame;
- v.CFrame = CFrame.new(((FunctionData.Move.TargetAxis.CFrame - FunctionData.Move.TargetAxis.Position) * CFrame.new(FunctionData.Move.x, FunctionData.Move.y, FunctionData.Move.z)).p) * v.CFrame;
- after[i]=v.CFrame;
- end
- elseif FunctionData.Move.WorldAxis then
- for i,v in pairs(p) do
- prior[i]=v.CFrame;
- v.CFrame = CFrame.new(FunctionData.Move.x, FunctionData.Move.y, FunctionData.Move.z) * v.CFrame;
- after[i]=v.CFrame;
- end
- elseif not FunctionData.Move.WorldAxis then
- for i,v in pairs(p) do
- prior[i]=v.CFrame;
- v.CFrame = v.CFrame * CFrame.new(FunctionData.Move.x, FunctionData.Move.y, FunctionData.Move.z);
- after[i]=v.CFrame;
- end
- end
- History.Action("Move", p, prior, after);
- pending_target=false;
- Passive(p);
- UpdateHandles();
- elseif c=="Button1Up" then
- aabb.Parent=LocalBin;
- axes_x.Parent=LocalBin;
- axes_y.Parent=LocalBin;
- axes_z.Parent=LocalBin;
- HandlesUp();
- Passive(p);
- UpdateHandles();
- handles.Visible=true;
- else
- Passive(p);
- end
- end
- tab_index = 0;
- FunctionData.Move = FunctionData.Move or {};
- FunctionData.Move.x = FunctionData.Move.x or 0;
- FunctionData.Move.y = FunctionData.Move.y or 0;
- FunctionData.Move.z = FunctionData.Move.z or 0;
- if FunctionData.Move.WorldAxis==nil then
- FunctionData.Move.WorldAxis = true;
- end
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(207/255,239/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Move" obj40.Position=UDim2.new(0,243,1,-110) obj40.Size=UDim2.new(0,114,0,110) obj40.Visible=true
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="xBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,110,0,18) obj41.Text="X" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,85/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="xButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,110,0,18) obj42.Text=tonumber(FunctionData.Move.x) or 0; obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextBox") obj43.BackgroundColor3=Color3.new(0/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="yBox" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,22) obj43.Size=UDim2.new(0,110,0,18) obj43.Text="Y" obj43.TextColor3=Color3.new(27/255,42/255,53/255) obj43.Visible=false obj43.ZIndex=2
- obj44=Instance.new("TextButton") obj44.BackgroundColor3=Color3.new(151/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Name="yButton" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,22) obj44.Size=UDim2.new(0,110,0,18) obj44.Text=tonumber(FunctionData.Move.y) or 0; obj44.TextColor3=Color3.new(27/255,42/255,53/255)
- obj45=Instance.new("TextBox") obj45.BackgroundColor3=Color3.new(255/255,0/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Name="zBox" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,42) obj45.Size=UDim2.new(0,110,0,18) obj45.Text="Z" obj45.TextColor3=Color3.new(27/255,42/255,53/255) obj45.Visible=false obj45.ZIndex=2
- obj46=Instance.new("TextButton") obj46.BackgroundColor3=Color3.new(255/255,143/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Name="zButton" obj46.Parent=obj40 obj46.Position=UDim2.new(0,2,0,42) obj46.Size=UDim2.new(0,110,0,18) obj46.Text=tonumber(FunctionData.Move.z) or 0; obj46.TextColor3=Color3.new(27/255,42/255,53/255)
- obj47=Instance.new("TextButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Name="WorldObjAxis" obj47.Parent=obj40 obj47.Position=UDim2.new(0,2,0,62) obj47.Size=UDim2.new(0,110,0,14) obj47.Text=FunctionData.Move.WorldAxis and "World Axis" or "Object Axis"; obj47.TextColor3=Color3.new(27/255,42/255,53/255)
- obj51=Instance.new("TextButton") obj51.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj51.BorderColor3=Color3.new(27/255,42/255,53/255) obj51.Name="TargetAxis" obj51.Parent=obj40 obj51.Position=UDim2.new(0,2,0,78) obj51.Size=UDim2.new(0,110,0,14) obj51.Text=FunctionData.Move.TargetAxis and "Axes Alignment Chosen" or "No Reference Part"; obj51.TextColor3=Color3.new(27/255,42/255,53/255)
- obj48=Instance.new("TextButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Name="Neg" obj48.Parent=obj40 obj48.Position=UDim2.new(0,2,0,94) obj48.Size=UDim2.new(0,35,0,14) obj48.Text="* -1" obj48.TextColor3=Color3.new(27/255,42/255,53/255)
- obj49=Instance.new("TextButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Name="Doub" obj49.Parent=obj40 obj49.Position=UDim2.new(0,39,0,94) obj49.Size=UDim2.new(0,36,0,14) obj49.Text="* 2" obj49.TextColor3=Color3.new(27/255,42/255,53/255)
- obj50=Instance.new("TextButton") obj50.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj50.BorderColor3=Color3.new(27/255,42/255,53/255) obj50.Name="Half" obj50.Parent=obj40 obj50.Position=UDim2.new(0,77,0,94) obj50.Size=UDim2.new(0,35,0,14) obj50.Text="* .5" obj50.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text = FunctionData.Move.x;
- obj44.Text = FunctionData.Move.y;
- obj46.Text = FunctionData.Move.z;
- obj40.Parent=obj1;
- obj48.MouseButton1Down:connect(function()
- FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Move.x = (FunctionData.Move.x or 0) * -1;
- FunctionData.Move.y = (FunctionData.Move.y or 0) * -1;
- FunctionData.Move.z = (FunctionData.Move.z or 0) * -1;
- obj42.Text = FunctionData.Move.x;
- obj44.Text = FunctionData.Move.y;
- obj46.Text = FunctionData.Move.z;
- end)
- obj49.MouseButton1Down:connect(function()
- FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Move.x = (FunctionData.Move.x or 0) * 2;
- FunctionData.Move.y = (FunctionData.Move.y or 0) * 2;
- FunctionData.Move.z = (FunctionData.Move.z or 0) * 2;
- obj42.Text = FunctionData.Move.x;
- obj44.Text = FunctionData.Move.y;
- obj46.Text = FunctionData.Move.z;
- end)
- obj50.MouseButton1Down:connect(function()
- FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Move.x = (FunctionData.Move.x or 0) * 0.5;
- FunctionData.Move.y = (FunctionData.Move.y or 0) * 0.5;
- FunctionData.Move.z = (FunctionData.Move.z or 0) * 0.5;
- obj42.Text = FunctionData.Move.x;
- obj44.Text = FunctionData.Move.y;
- obj46.Text = FunctionData.Move.z;
- end)
- sb=Instance.new("SelectionBox");
- sb.Name="PendingDistinguisher";
- sb.Color=Options.ActiveSelectionBoxColor;
- sb.Visible=false;
- sb.Parent=obj1;
- handles=Instance.new("Handles");
- handles.Color=Options.DragHandlesColor;
- handles.Parent=obj1;
- aabb=Instance.new("Part");
- aabb.Anchored=true;
- aabb.CanCollide=false;
- aabb.Transparency=1;
- aabb.Parent=LocalBin;
- aabb.Name="AABB";
- axes_x=Instance.new("Part");
- axes_x.Anchored=true;
- axes_x.CanCollide=false;
- axes_x.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_x;
- axes_x.Name="axes_x";
- axes_x.formFactor=0;
- axes_x.Size=Vector3.new(1, 3, 1);
- axes_x.BrickColor=BrickColor.new("Bright yellow");
- axes_x.Parent=LocalBin;
- axes_y=Instance.new("Part");
- axes_y.Anchored=true;
- axes_y.CanCollide=false;
- axes_y.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_y;
- axes_y.Name="axes_x";
- axes_y.formFactor=0;
- axes_y.Size=Vector3.new(1, 3, 1);
- axes_y.BrickColor=BrickColor.new("Cyan");
- axes_y.Parent=LocalBin;
- axes_z=Instance.new("Part");
- axes_z.Anchored=true;
- axes_z.CanCollide=false;
- axes_z.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_z;
- axes_z.Name="axes_x";
- axes_z.formFactor=0;
- axes_z.Size=Vector3.new(1, 3, 1);
- axes_z.BrickColor=BrickColor.new("Magenta");
- axes_z.Parent=LocalBin;
- function UpdateHandles()
- if #HasPermission(GetParts(Selection.Get()),"handles_drag")==1 and not FunctionData.Move.WorldAxis and not FunctionData.Move.TargetAxis then
- local p=HasPermission(GetParts(Selection.Get()),"handles_drag")[1];
- handles.Adornee=p;
- if Options.ThreeAxes then
- axes_x.Transparency=0;
- axes_y.Transparency=0;
- axes_z.Transparency=0;
- axes_x.CFrame=p.CFrame*CFrame.Angles(0, 0, -math.pi/2)*CFrame.new(0, p.Size.x/2+axes_x.Size.y/2,0);
- axes_y.CFrame=p.CFrame*CFrame.new(0, p.Size.y/2+axes_y.Size.y/2,0);
- axes_z.CFrame=p.CFrame*CFrame.Angles(math.pi/2, 0, 0)*CFrame.new(0, p.Size.z/2+axes_x.Size.y/2,0);
- end
- elseif #Selection.Get()==0 then
- handles.Adornee=nil;
- axes_x.Transparency=1;
- axes_y.Transparency=1;
- axes_z.Transparency=1;
- elseif FunctionData.Move.TargetAxis then
- min, max, _min, _max = angledAABB(GetParts(Selection.Get()), FunctionData.Move.TargetAxis.CFrame);
- aabb.Size = _max - _min;
- aabb.CFrame = CFrame.new(min:lerp(max, .5)) * (FunctionData.Move.TargetAxis.CFrame - FunctionData.Move.TargetAxis.Position);
- handles.Adornee=aabb;
- if Options.ThreeAxes then
- axes_x.Transparency=0;
- axes_y.Transparency=0;
- axes_z.Transparency=0;
- axes_x.CFrame=aabb.CFrame*CFrame.Angles(0, 0, -math.pi/2)*CFrame.new(0, aabb.Size.x/2+axes_x.Size.y/2,0);
- axes_y.CFrame=aabb.CFrame*CFrame.new(0, aabb.Size.y/2+axes_y.Size.y/2,0);
- axes_z.CFrame=aabb.CFrame*CFrame.Angles(math.pi/2, 0, 0)*CFrame.new(0, aabb.Size.z/2+axes_x.Size.y/2,0);
- end
- else
- min, max = getAABB(GetParts(Selection.Get()));
- aabb.Size = max - min;
- aabb.CFrame = CFrame.new(min:lerp(max, .5));
- handles.Adornee=aabb;
- if Options.ThreeAxes then
- axes_x.Transparency=0;
- axes_y.Transparency=0;
- axes_z.Transparency=0;
- axes_x.CFrame=aabb.CFrame*CFrame.Angles(0, 0, -math.pi/2)*CFrame.new(0, aabb.Size.x/2+axes_x.Size.y/2,0);
- axes_y.CFrame=aabb.CFrame*CFrame.new(0, aabb.Size.y/2+axes_y.Size.y/2,0);
- axes_z.CFrame=aabb.CFrame*CFrame.Angles(math.pi/2, 0, 0)*CFrame.new(0, aabb.Size.z/2+axes_x.Size.y/2,0);
- end
- end
- end;
- UpdateHandles();
- round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
- function HandlesUp()
- if #original_locations>0 and handles_dragging_parts then
- final_locations={};
- for i,v in pairs(handles_dragging_parts) do
- final_locations[#final_locations + 1] = v.CFrame;
- end
- History.Action("Move", handles_dragging_parts, original_locations, final_locations);
- original_locations={};
- end
- end;
- handles_dragging_parts={};
- old_distance=0;
- original_locations={};
- final_locations={};
- handles.MouseButton1Down:connect(function()
- handles_dragging_parts=HasPermission(GetParts(Selection.Get()), "handles_drag")
- original_locations={};
- for i,v in pairs(handles_dragging_parts) do
- original_locations[#original_locations + 1] = v.CFrame;
- end
- old_distance = 0;
- end)
- handles.MouseButton1Up:connect(HandlesUp)
- handles.MouseDrag:connect(function(face, dist)
- new_distance = round(dist - old_distance, Options.MoveDragIntervals);
- old_distance = old_distance + new_distance;
- if new_distance~=0 then
- local faces=Vector3.new();
- if face==Enum.NormalId.Left then
- faces=Vector3.new(-1, 0, 0);
- elseif face==Enum.NormalId.Right then
- faces=Vector3.new(1, 0, 0);
- elseif face==Enum.NormalId.Top then
- faces=Vector3.new(0, 1, 0);
- elseif face==Enum.NormalId.Bottom then
- faces=Vector3.new(0, -1, 0);
- elseif face==Enum.NormalId.Front then
- faces=Vector3.new(0, 0, -1);
- elseif face==Enum.NormalId.Back then
- faces=Vector3.new(0, 0, 1);
- end
- if handles.Adornee==aabb then
- for i,v in pairs(handles_dragging_parts) do
- v.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(v.CFrame);
- end
- axes_x.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_x.CFrame);
- axes_y.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_y.CFrame);
- axes_z.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_z.CFrame);
- aabb.CFrame=aabb.CFrame*CFrame.new(faces * new_distance);
- else
- for i,v in pairs(handles_dragging_parts) do
- v.CFrame=v.CFrame*CFrame.new(faces * new_distance);
- end
- UpdateHandles();
- end
- end
- end)
- TB.insert(obj41, obj42);
- TB.insert(obj43, obj44);
- TB.insert(obj45, obj46);
- obj47.MouseButton1Down:connect(function()
- FunctionData.Move.WorldAxis = not FunctionData.Move.WorldAxis;
- obj47.Text=FunctionData.Move.WorldAxis and "World Axis" or "Object Axis";
- end)
- pending_target = false;
- obj51.MouseButton1Down:connect(function()
- pending_target = not pending_target;
- if pending_target then
- sb.Visible=true;
- obj51.Text = "Pending Selection...";
- else
- sb.Visible=false;
- FunctionData.Move.TargetAxis = nil;
- obj51.Text = "No Reference Part";
- end
- end)
- function angledAABB(parts, cframe)
- if type(parts)~="table" then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
- if #parts==0 then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
- --local min=parts[1].Position
- --local max=parts[1].Position
- local min=Vector3.new(math.huge, math.huge, math.huge);
- local max=Vector3.new(-math.huge, -math.huge, -math.huge);
- for i,v in pairs(parts) do
- for x=-1,1,2 do
- for y=-1,1,2 do
- for z=-1,1,2 do
- local s=v.Size/2;
- local p = (v.CFrame * CFrame.new(x*s.x, y*s.y, z*s.z)).p;
- min=Vector3.new(math.min(DistanceAlongLine(Vector3.new(0,0,0), (cframe*CFrame.Angles(0,math.pi/2,0)).lookVector, p), min.x),math.min(DistanceAlongLine(Vector3.new(0,0,0), (cframe*CFrame.Angles(math.pi/2,0,0)).lookVector, p), min.y),math.min(DistanceAlongLine(Vector3.new(0,0,0), cframe.lookVector, p), min.z))
- max=Vector3.new(math.max(DistanceAlongLine(Vector3.new(0,0,0), (cframe*CFrame.Angles(0,math.pi/2,0)).lookVector, p), max.x),math.max(DistanceAlongLine(Vector3.new(0,0,0), (cframe*CFrame.Angles(math.pi/2,0,0)).lookVector, p), max.y),math.max(DistanceAlongLine(Vector3.new(0,0,0), cframe.lookVector, p), max.z))
- end
- end
- end
- end
- return min.x*(cframe*CFrame.Angles(0,math.pi/2,0)).lookVector+min.y*(cframe*CFrame.Angles(math.pi/2,0,0)).lookVector+min.z*cframe.lookVector,max.x*(cframe*CFrame.Angles(0,math.pi/2,0)).lookVector+max.y*(cframe*CFrame.Angles(math.pi/2,0,0)).lookVector+max.z*cframe.lookVector, min, max
- end
- end
- --[[Options]]
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Options()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- if obj60~=nil then obj60.Parent=nil; end
- if f~=nil then f.Parent=nil; end
- obj40.Parent=nil;
- return;
- elseif c=="Move" then
- if obj66~=nil and obj66.Name=="ToolTipDisplay" then obj66.Visible=false; end
- Passive(p);
- return;
- else
- Passive(p);
- end
- end
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(163/255,162/255,165/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Options" obj40.Position=UDim2.new(0.5,-183,0.5,-115) obj40.Size=UDim2.new(0,366,0,230) obj40.BackgroundColor3=Options.MainColor;
- obj41=Instance.new("TextLabel") obj41.Active=false obj41.BackgroundColor3=Color3.new(163/255,162/255,165/255) obj41.BackgroundTransparency=1 obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Parent=obj40 obj41.Position=UDim2.new(0,0,0,0) obj41.Size=UDim2.new(1,0,0,30) obj41.Text="Options" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.FontSize=Enum.FontSize.Size18
- obj42=Instance.new("TextButton") obj42.Name="RepeatDelay" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,32) obj42.Size=UDim2.new(0.5,-3,0,20) obj42.Text="Repeat Delay: 1" obj42.TextXAlignment=Enum.TextXAlignment.Left; obj42.BackgroundColor3=Options.ButtonColor;
- obj43=Instance.new("TextButton") obj43.Name="RepeatRate" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,54) obj43.Size=UDim2.new(0.5,-3,0,20) obj43.Text="Repeat Rate: 0.03" obj43.TextXAlignment=Enum.TextXAlignment.Left; obj43.BackgroundColor3=Options.ButtonColor;
- obj44=Instance.new("TextButton") obj44.Name="DoubleClickSpeed" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,76) obj44.Size=UDim2.new(0.5,-3,0,20) obj44.Text="Double Click Speed: 0.03" obj44.TextXAlignment=Enum.TextXAlignment.Left; obj44.BackgroundColor3=Options.ButtonColor;
- obj45=Instance.new("TextButton") obj45.Name="BoundingBoxColor" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,98) obj45.Size=UDim2.new(0.5,-3,0,20) obj45.Text="Bounding Box Color: Cyan" obj45.TextXAlignment=Enum.TextXAlignment.Left; obj45.BackgroundColor3=Options.ButtonColor;
- obj46=Instance.new("TextButton") obj46.Name="ActiveSelectionBoxColor" obj46.Parent=obj40 obj46.Position=UDim2.new(0,2,0,120) obj46.Size=UDim2.new(0.5,-3,0,20) obj46.Text="Active Selection Color: Really red" obj46.TextXAlignment=Enum.TextXAlignment.Left; obj46.BackgroundColor3=Options.ButtonColor;
- obj47=Instance.new("TextButton") obj47.Name="DragHandlesColor" obj47.Parent=obj40 obj47.Position=UDim2.new(0,2,0,142) obj47.Size=UDim2.new(0.5,-3,0,20) obj47.Text="Drag Handles Color: Bright orange" obj47.TextXAlignment=Enum.TextXAlignment.Left; obj47.BackgroundColor3=Options.ButtonColor;
- obj48=Instance.new("TextButton") obj48.Name="RotateHandlesColor" obj48.Parent=obj40 obj48.Position=UDim2.new(0,2,0,164) obj48.Size=UDim2.new(0.5,-3,0,20) obj48.Text="Rotate Handles Color: Bright red" obj48.TextXAlignment=Enum.TextXAlignment.Left; obj48.BackgroundColor3=Options.ButtonColor;
- obj49=Instance.new("TextButton") obj49.Name="ResizeHandlesColor" obj49.Parent=obj40 obj49.Position=UDim2.new(0,2,0,186) obj49.Size=UDim2.new(0.5,-3,0,20) obj49.Text="Resize Handles Color: Bright blue" obj49.TextXAlignment=Enum.TextXAlignment.Left; obj49.BackgroundColor3=Options.ButtonColor;
- obj50=Instance.new("TextButton") obj50.Name="SurfaceSelectionColor" obj50.Parent=obj40 obj50.Position=UDim2.new(0,2,0,208) obj50.Size=UDim2.new(0.5,-3,0,20) obj50.Text="Surface Selection Color: Bright violet" obj50.TextXAlignment=Enum.TextXAlignment.Left; obj50.BackgroundColor3=Options.ButtonColor;
- obj51=Instance.new("TextButton") obj51.Name="SmallestSize" obj51.Parent=obj40 obj51.Position=UDim2.new(0.5,1,0,98) obj51.Size=UDim2.new(0.5,-3,0,20) obj51.Text="Smallest Part Size: 1, 1, 1" obj51.TextXAlignment=Enum.TextXAlignment.Left; obj51.BackgroundColor3=Options.ButtonColor;
- obj52=Instance.new("TextButton") obj52.Name="CloneShift" obj52.Parent=obj40 obj52.Position=UDim2.new(0.5,1,0,120) obj52.Size=UDim2.new(0.5,-3,0,20) obj52.Text="Clone Shift: true" obj52.TextXAlignment=Enum.TextXAlignment.Left; obj52.BackgroundColor3=Options.ButtonColor;
- obj53=Instance.new("TextButton") obj53.Name="Permissions" obj53.Parent=obj40 obj53.Position=UDim2.new(0.5,1,0,208) obj53.Size=UDim2.new(0.5,-3,0,20) obj53.Text="Permissions Editor" obj53.TextXAlignment=Enum.TextXAlignment.Left; obj53.BackgroundColor3=Options.ButtonColor;
- obj54=Instance.new("TextButton") obj54.Name="DockVisible" obj54.Parent=obj40 obj54.Position=UDim2.new(0.5,1,0,186) obj54.Size=UDim2.new(0.5,-3,0,20) obj54.Text="Dock Visible: true" obj54.TextXAlignment=Enum.TextXAlignment.Left; obj54.BackgroundColor3=Options.ButtonColor;
- obj55=Instance.new("TextButton") obj55.Name="ToolTip" obj55.Parent=obj40 obj55.Position=UDim2.new(0.5,1,0,164) obj55.Size=UDim2.new(0.5,-3,0,20) obj55.Text="ToolTipText: on" obj55.TextXAlignment=Enum.TextXAlignment.Left; obj55.BackgroundColor3=Options.ButtonColor;
- obj56=Instance.new("TextButton") obj56.Name="ThreeAxes" obj56.Parent=obj40 obj56.Position=UDim2.new(0.5,1,0,142) obj56.Size=UDim2.new(0.5,-3,0,20) obj56.Text="Three Axes: on" obj56.TextXAlignment=Enum.TextXAlignment.Left; obj56.BackgroundColor3=Options.ButtonColor;
- obj57=Instance.new("TextButton") obj57.Name="ResizeDragIntervals" obj57.Parent=obj40 obj57.Position=UDim2.new(0.5,1,0,76) obj57.Size=UDim2.new(0.5,-3,0,20) obj57.Text="Resize Increments: 1" obj57.TextXAlignment=Enum.TextXAlignment.Left; obj57.BackgroundColor3=Options.ButtonColor;
- obj58=Instance.new("TextButton") obj58.Name="MoveDragIntervals" obj58.Parent=obj40 obj58.Position=UDim2.new(0.5,1,0,32) obj58.Size=UDim2.new(0.5,-3,0,20) obj58.Text="Move Increments: 0.5" obj58.TextXAlignment=Enum.TextXAlignment.Left; obj58.BackgroundColor3=Options.ButtonColor;
- obj59=Instance.new("TextButton") obj59.Name="RotateDragIntervals" obj59.Parent=obj40 obj59.Position=UDim2.new(0.5,1,0,54) obj59.Size=UDim2.new(0.5,-3,0,20) obj59.Text="Rotate Increments: 5" obj59.TextXAlignment=Enum.TextXAlignment.Left; obj59.BackgroundColor3=Options.ButtonColor;
- obj40.Parent=gui;
- brickcolors={
- {obj45, "Bounding Box Color", "BoundingBoxColor", "Determines the color of the selection boxes that surround selected parts."},
- {obj46, "Active Selection Color", "ActiveSelectionBoxColor", "Determines the color of the selection box that is used when choosing a part."},
- {obj47, "Drag Handles Color", "DragHandlesColor", "Determines the color of the dragging handles for movement."},
- {obj48, "Rotate Handles Color", "RotateHandlesColor", "Determines the color of the dragging handles for rotation."},
- {obj49, "Resize Handles Color", "ResizeHandlesColor", "Determines the color of the dragging handles for resizing."},
- {obj50, "Surface Selection Color", "SurfaceSelectionColor", "Determines the color of the selection panel that is used when selecting a surface of a part."},
- }
- all_colors = {"Institutional white","White","Phosph. White","Transparent","Light stone grey","Mid gray","Light grey","Tr. Brown","Light grey metallic","Medium stone grey","Silver","Grey","Silver flip/flop","Gun metallic","Dark grey","Dark stone grey","Dark grey metallic","Black metallic","Black","Really black","Light red","Pastel orange","Tr. Flu. Reddish orange","Medium red","Tr. Red","Bright red","Really red","Dusty Rose","Dark red","Red flip/flop","Sand red","Light orange","Medium orange","Warm yellowish orange","Bright orange","Deep orange","Neon orange","Flame reddish orange","CGA brown","Dark orange","Br. yellowish orange","Br. reddish orange","Med. yellowish orange","Curry","Dark Curry","Light orange brown","Pastel brown","Yellow flip/flop","Light brick yellow","Brown","Nougat","Dark nougat","Earth orange","Reddish brown","Rust","Gold","Earth yellow","Brick yellow","Lig. Yellowich orange","Pastel yellow","Light yellow","Cool yellow","Tr. Yellow","Tr. Flu. Green","Tr. Flu. Yellow","Flame yellowish orange","Fire Yellow","Bright yellow","New Yeller","Sand yellow","Sand yellow metallic","Lig. yellowish green","Med. yellowish green","Olive","Grime","Faded green","Neon green","Light green (Mint)","Br. yellowish green","Lime green","Bright green","Camo","Dark green","Earth green","Pastel green","Medium green","Sand green","Tr. Green","Lemon metalic","Light blue","Tr. Lg blue","Tr. Flu. Blue","Light bluish green","Light Royal blue","Pastel light blue","Light bluish violet","Pastel blue-green","Pastel Blue","Turquoise","Med. bluish green","Medium blue","Dove blue","Tr. Blue","Toothpaste","Teal","Cyan","Bright bluish green","Bright blue","Really blue","Navy blue","Earth blue","Medium Royal blue","Medium bluish violet","Royal blue","Bright bluish violet","Deep blue","Dark Royal blue","Sand blue metallic","Sand blue","Tr. Bright bluish violet","Pastel violet","Light lilac","Alder","Lilac","Reddish lilac","Lavender","Royal purple","Bright violet","Tr. Medi. reddish violet","Light reddish violet","Light purple","Tr. Flu. Red","Light pink","Pink","Hot pink","Magenta","Bright purple","Med. reddish violet","Bright reddish lilac","Bright reddish violet","Medium lilac","Sand violet metallic","Sand violet"};
- numbers={
- {obj42, "Repeat Delay", "RepeatDelay", "The amount of time that elapses before the tab button begins to repeat."},
- {obj43, "Repeat Rate", "RepeatRate", "The amount of time between tab hits."},
- {obj44, "Double Click Speed", "DoubleClickSpeed", "How quickly you have to double click in order to select the target's parent."},
- {obj57, "Resize Increments", "ResizeDragIntervals", "The factor by which you'll resize when clicking and dragging on a handle."},
- {obj58, "MoveIncrements", "MoveDragIntervals", "The factor by which you'll move when clicking and dragging on a handle."},
- {obj59, "RotateIncrements", "RotateDragIntervals", "The factor by which you'll rotate when clicking and dragging on a handle."},
- }
- boolean={
- {obj52, "Clone Shift", function(bool) return (bool and "true" or "false"); end, "CloneShift", "Determines whether cloned parts get moved above the old part, or whether they remain in the same location."},
- {obj54, "Dock Visible", function(bool) return (bool and "true" or "false"); end, "DockVisible", "Whether or not the dock above the main tool window is visible."},
- {obj56, "Three Axes", function(bool) return (bool and "on" or "off"); end, "ThreeAxes", "Determines if the three axes indicators are turned on."},
- }
- --toggle is used for text properties that have a select series of values.
- toggle={
- {obj55, "Tool Tip Text", "ToolTipText", "Determines if you can hover over colors and materials to identify their name.", {"off", "on", "immediate"}},
- }
- vector3={
- {obj51, "Smallest Size", "SmallestSize", "The smallest size you can resize a part to when dragging. Type in 3 numbers separated by commas."},
- }
- UpdateButtons=function()
- for i,v in pairs(vector3) do
- v[1].Text=v[2] .. ": " .. tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
- end
- for i,v in pairs(numbers) do
- v[1].Text=v[2] .. ": " .. tostring(Options[v[3]]);
- end
- for i,v in pairs(toggle) do
- v[1].Text=v[2]..": "..Options[v[3]];
- end
- for i,v in pairs(brickcolors) do
- v[1].Text=v[2]..": "..Options[v[3]].Name;
- end
- for i,v in pairs(boolean) do
- v[1].Text=v[2] .. ": " .. v[3](Options[v[4]]);
- end
- end;
- for i,v in pairs(vector3) do
- v[1].Text=v[2] .. ": " .. tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
- v[1].MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- obj60=Instance.new("Frame") obj60.Name="Choice" obj60.Position=UDim2.new(0.5,-100,0.5,-40) obj60.Size=UDim2.new(0,200,0,80) obj60.BackgroundColor3=Options.MainColor;
- obj61=Instance.new("TextBox") obj61.Name="Entry" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,20) obj61.Size=UDim2.new(1,-4,0,16) obj61.BackgroundColor3=Options.ButtonColor;
- obj62=Instance.new("TextLabel") obj62.Active=false obj62.Name="Name" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,2) obj62.Size=UDim2.new(1,-4,0,16) obj62.BackgroundTransparency=1;
- obj63=Instance.new("TextLabel") obj63.Active=false obj63.Name="Description" obj63.Parent=obj60 obj63.Position=UDim2.new(0,2,0,56) obj63.Size=UDim2.new(1,-4,1,-40) obj63.TextWrap=true; obj63.BackgroundTransparency=1;
- obj64=Instance.new("TextButton") obj64.Name="Submit" obj64.Parent=obj60 obj64.Position=UDim2.new(0,2,0,38) obj64.Size=UDim2.new(1,-4,0,16) obj64.BackgroundColor3=Options.ButtonColor; obj64.Text="Submit";
- obj60.Parent=gui;
- obj61.Text=tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
- obj62.Text=v[2];
- obj63.Text=v[4];
- obj64.MouseButton1Down:connect(function()
- entry=obj61.Text;
- f1=string.find(entry, ",");
- if f1~=nil then
- x=string.gsub(string.sub(entry, 1, f1-1), " ", ""); x=tonumber(x) or 1;
- entry=string.sub(entry, f1+1);
- f1=string.find(entry, ",");
- if f1~=nil then
- y=string.gsub(string.sub(entry, 1, f1-1), " ", ""); y=tonumber(y) or 1;
- z=string.gsub(string.sub(entry, f1+1), " ", ""); z=tonumber(z) or 1;
- Options[v[3]]=Vector3.new(x,y,z);
- else
- Options[v[3]]=Vector3.new(1,x,1);
- end
- else
- Options[v[3]]=Vector3.new(1,1,1);
- end
- UpdateButtons();
- if obj60~=nil then obj60.Parent=nil; end
- end)
- end)
- end
- for i,v in pairs(numbers) do
- v[1].Text=v[2] .. ": " .. tostring(Options[v[3]]);
- v[1].MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- obj60=Instance.new("Frame") obj60.Name="Choice" obj60.Position=UDim2.new(0.5,-100,0.5,-40) obj60.Size=UDim2.new(0,200,0,80) obj60.BackgroundColor3=Options.MainColor;
- obj61=Instance.new("TextBox") obj61.Name="Entry" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,20) obj61.Size=UDim2.new(1,-4,0,16) obj61.BackgroundColor3=Options.ButtonColor;
- obj62=Instance.new("TextLabel") obj62.Active=false obj62.Name="Name" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,2) obj62.Size=UDim2.new(1,-4,0,16) obj62.BackgroundTransparency=1;
- obj63=Instance.new("TextLabel") obj63.Active=false obj63.Name="Description" obj63.Parent=obj60 obj63.Position=UDim2.new(0,2,0,56) obj63.Size=UDim2.new(1,-4,1,-40) obj63.TextWrap=true; obj63.BackgroundTransparency=1;
- obj64=Instance.new("TextButton") obj64.Name="Submit" obj64.Parent=obj60 obj64.Position=UDim2.new(0,2,0,38) obj64.Size=UDim2.new(1,-4,0,16) obj64.BackgroundColor3=Options.ButtonColor; obj64.Text="Submit";
- obj60.Parent=gui;
- obj61.Text=Options[v[3]];
- obj62.Text=v[2];
- obj63.Text=v[4];
- obj64.MouseButton1Down:connect(function()
- Options[v[3]]=math.abs(tonumber(obj61.Text=="" and "0" or obj61.Text) or 0);
- UpdateButtons();
- if obj60~=nil then obj60.Parent=nil; end
- end)
- end)
- end
- for i,v in pairs(boolean) do
- v[1].Text=v[2] .. ": " .. v[3](Options[v[4]]);
- v[1].MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- obj60=Instance.new("Frame") obj60.Name="Choice" obj60.Position=UDim2.new(0.5,-100,0.5,-40) obj60.Size=UDim2.new(0,200,0,80) obj60.BackgroundColor3=Options.MainColor;
- obj61=Instance.new("TextButton") obj61.Name="Entry" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,20) obj61.Size=UDim2.new(1,-4,0,16) obj61.BackgroundColor3=Options.ButtonColor
- obj62=Instance.new("TextLabel") obj62.Active=false obj62.Name="Name" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,2) obj62.Size=UDim2.new(1,-4,0,16) obj62.BackgroundTransparency=1;
- obj63=Instance.new("TextLabel") obj63.Active=false obj63.Name="Description" obj63.Parent=obj60 obj63.Position=UDim2.new(0,2,0,56) obj63.Size=UDim2.new(1,-4,1,-40) obj63.TextWrap=true; obj63.BackgroundTransparency=1;
- obj64=Instance.new("TextButton") obj64.Name="Submit" obj64.Parent=obj60 obj64.Position=UDim2.new(0,2,0,38) obj64.Size=UDim2.new(1,-4,0,16) obj64.BackgroundColor3=Options.ButtonColor; obj64.Text="Submit";
- obj60.Parent=gui;
- obj61.Text=v[3](Options[v[4]]);
- obj62.Text=v[2];
- obj63.Text=v[5];
- obj61.MouseButton1Down:connect(function()
- Options[v[4]]=not Options[v[4]]
- obj61.Text=v[3](Options[v[4]]);
- end)
- obj64.MouseButton1Down:connect(function()
- UpdateButtons();
- if obj60~=nil then obj60.Parent=nil; end
- end)
- end)
- end
- for i,v in pairs(toggle) do
- v[1].Text=v[2]..": "..Options[v[3]];
- v[1].MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- obj60=Instance.new("Frame") obj60.Name="Choice" obj60.Position=UDim2.new(0.5,-100,0.5,-40) obj60.Size=UDim2.new(0,200,0,80) obj60.BackgroundColor3=Options.MainColor;
- obj61=Instance.new("TextButton") obj61.Name="Entry" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,20) obj61.Size=UDim2.new(1,-4,0,16) obj61.BackgroundColor3=Options.ButtonColor
- obj62=Instance.new("TextLabel") obj62.Active=false obj62.Name="Name" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,2) obj62.Size=UDim2.new(1,-4,0,16) obj62.BackgroundTransparency=1;
- obj63=Instance.new("TextLabel") obj63.Active=false obj63.Name="Description" obj63.Parent=obj60 obj63.Position=UDim2.new(0,2,0,56) obj63.Size=UDim2.new(1,-4,1,-40) obj63.TextWrap=true; obj63.BackgroundTransparency=1;
- obj64=Instance.new("TextButton") obj64.Name="Submit" obj64.Parent=obj60 obj64.Position=UDim2.new(0,2,0,38) obj64.Size=UDim2.new(1,-4,0,16) obj64.BackgroundColor3=Options.ButtonColor; obj64.Text="Submit";
- obj60.Parent=gui;
- obj61.Text=(Options[v[3]]);
- obj62.Text=v[2];
- obj63.Text=v[4];
- obj61.MouseButton1Down:connect(function()
- for a,b in pairs(v[5]) do
- if b==Options[v[3]] then
- index=a;
- end
- end
- index=index+1;
- if v[5][index]==nil then index=1 end
- Options[v[3]]=v[5][index];
- obj61.Text=(Options[v[3]]);
- end)
- obj64.MouseButton1Down:connect(function()
- UpdateButtons();
- if obj60~=nil then obj60.Parent=nil; end
- end)
- end)
- end
- for i,v in pairs(brickcolors) do
- v[1].Text=v[2]..": "..Options[v[3]].Name;
- v[1].MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- obj60=Instance.new("Frame") obj60.Name="Choice" obj60.Position=UDim2.new(0.5,-100,0.5,-40) obj60.Size=UDim2.new(0,200,0,80) obj60.BackgroundColor3=Options.MainColor;
- obj61=Instance.new("TextButton") obj61.Name="Entry" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,20) obj61.Size=UDim2.new(1,-4,0,16) obj61.BackgroundColor3=Options.ButtonColor
- obj62=Instance.new("TextLabel") obj62.Active=false obj62.Name="Name" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,2) obj62.Size=UDim2.new(1,-4,0,16) obj62.BackgroundTransparency=1;
- obj63=Instance.new("TextLabel") obj63.Active=false obj63.Name="Description" obj63.Parent=obj60 obj63.Position=UDim2.new(0,2,0,56) obj63.Size=UDim2.new(1,-4,1,-40) obj63.TextWrap=true; obj63.BackgroundTransparency=1;
- obj64=Instance.new("TextButton") obj64.Name="Submit" obj64.Parent=obj60 obj64.Position=UDim2.new(0,2,0,38) obj64.Size=UDim2.new(1,-4,0,16) obj64.BackgroundColor3=Options.ButtonColor; obj64.Text="Submit";
- obj60.Parent=gui;
- obj61.Text=Options[v[3]].Name;
- obj62.Text=v[2];
- obj63.Text=v[4];
- obj61.MouseButton1Down:connect(function(x,y)
- f=Instance.new("Frame");
- f.Size=UDim2.new(0, 13*(15)+2*(13+1), 0, 11*(15)+2*(11+1)); --number of tiles wide: 13, number of tiles tall: 11, spacing: 2, width and heightof each tile: 15
- f.Position=UDim2.new(0, x, 0, y);
- f.Parent=gui;
- for i=0,142,1 do
- local tile=Instance.new("TextButton")
- tile.BorderColor3=Color3.new(8/255,8/255,8/255)
- tile.Name=tostring(i+1)
- tile.Position=UDim2.new(0,2+(i%13)*17,0,2+(math.floor(i/13))*17)
- tile.Size=UDim2.new(0,19,0,19)
- tile.Text=""
- tile.BackgroundColor3=BrickColor.new(all_colors[i+1]).Color
- tile.MouseButton1Down:connect(function()
- Options[v[3]]=BrickColor.new(all_colors[tonumber(tile.Name)]);
- f.Parent=nil;
- end)
- tile.Parent=f
- end
- obj61.Text=(Options[v[3]].Name);
- end)
- obj64.MouseButton1Down:connect(function()
- UpdateButtons();
- if obj60~=nil then obj60.Parent=nil; end
- end)
- end)
- end
- obj53.MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- PermissionsIndex=1;
- PermissionsGiven=true;
- permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
- obj60=Instance.new("Frame") obj60.Position=UDim2.new(0.5,-57,0.5,-35) obj60.Size=UDim2.new(0,130,0,78)
- obj61=Instance.new("TextLabel") obj61.Active=false obj61.Name="PlayerName" obj61.Parent=obj60 obj61.Position=UDim2.new(0,2,0,2) obj61.Size=UDim2.new(1,-4,0,12)
- obj62=Instance.new("TextButton") obj62.Name="Previous" obj62.Parent=obj60 obj62.Position=UDim2.new(0,2,0,64) obj62.Size=UDim2.new(0,16,0,12) obj62.Text="<"
- obj63=Instance.new("TextButton") obj63.Name="Next" obj63.Parent=obj60 obj63.Position=UDim2.new(0,20,0,64) obj63.Size=UDim2.new(0,16,0,12) obj63.Text=">"
- obj64=Instance.new("TextButton") obj64.Name="SwapMode" obj64.Parent=obj60 obj64.Position=UDim2.new(0,38,0,64) obj64.Size=UDim2.new(0,48,0,12) obj64.Text="Given"
- obj65=Instance.new("TextButton") obj65.Name="Submit" obj65.Parent=obj60 obj65.Position=UDim2.new(0,88,0,64) obj65.Size=UDim2.new(0,40,0,12) obj65.Text="Submit"
- obj66=Instance.new("TextLabel"); obj66.Size=UDim2.new(0, 140, 0, 80); obj66.Parent=obj60; obj66.Visible=false; obj66.BackgroundColor3=Options.ToolTipColor; obj66.Text=""; obj66.TextWrap=true; obj66.ZIndex=2; obj66.Name="ToolTipDisplay";
- obj60.BackgroundColor3=Options.MainColor;
- obj61.BackgroundColor3=Options.ButtonColor;
- obj62.BackgroundColor3=Options.ButtonColor;
- obj63.BackgroundColor3=Options.ButtonColor;
- obj64.BackgroundColor3=Options.ButtonColor;
- obj65.BackgroundColor3=Options.ButtonColor;
- local buttons={};
- local Refresh=function()
- if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=#game.Players:GetChildren(); end
- permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
- obj61.Text=permissionsTarget.Name;
- if PermissionsGiven then
- for i,v in pairs(buttons) do
- v.Text=UserPermission(permissionsTarget, game.Players.LocalPlayer, _possible_permissions[tonumber(v.Name)]) and "X" or " ";
- end
- else
- v.Text=UserPermission(game.Players.LocalPlayer, permissionsTarget, _possible_permissions[tonumber(v.Name)]) and "X" or " ";
- end
- end;
- local descriptions={"Allow player to select your parts", "Allow player to drag your parts around", "Allow player to clone your parts", " Allow player to drag your parts around via movement handles", "Allow player to move your parts via Apply button.", "Allow player to resize your parts via resize handles", "Allow player to resize your parts via Apply button", "Allow player to rotate your parts via rotational handles", "Allow player to rotate your parts via Apply button", "Allow player to lock your parts", "Allow player to color your parts", "Allow player to change the material of your parts", "Allow player to change transparency of your parts", "Allow player to change reflectance of your parts", "Allow player to anchor/unanchor your parts", "Allow player to change CanCollide of your parts", "Allow player to change the form factor of your parts", "Allow player to change the shape of your parts", "Allow player to change the surface of your parts", "Allow player to change the velocity of your parts", "Allow player to change the rotational velocity of your parts", "Allow player to change the friction of your parts", "Allow player to delete your parts", "Allow player to save your parts"};
- for x=1,8 do
- for y=1,3 do
- local button=Instance.new("TextButton");
- button.Name=tostring((y-1)*8+x);
- button.Position=UDim2.new(0,2+(x-1)*16,0,16+(y-1)*16);
- button.Size=UDim2.new(0,14,0,14);
- button.BackgroundColor3=Options.ButtonColor;
- button.Parent=obj60;
- button.Text=UserPermission(permissionsTarget, game.Players.LocalPlayer, _possible_permissions[(y-1)*8+x]) and "X" or " ";
- buttons[#buttons+1]=button;
- button.MouseMoved:connect(function(x,y)
- obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
- obj66.Text=descriptions[tonumber(button.Name)];
- obj66.Visible=true;
- end)
- button.MouseButton1Down:connect(function()
- if not PermissionsGiven then
- PermissionsGiven=true;
- obj64.Text=PermissionsGiven and "Given" or "Recieved";
- end
- if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=#game.Players:GetChildren(); end
- permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
- if obj61.Text==permissionsTarget.Name then --just to make sure nothing unexpected is going on
- permissions=game.Players.LocalPlayer:findFirstChild("BuildPermissions");
- if permissions~=nil then
- if permissions:findFirstChild(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)]) then
- permissions[(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)])].Value=not permissions[(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)])].Value;
- else
- local q=Instance.new("BoolValue");
- q.Name=permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)];
- q.Value=true;
- q.Parent=permissions;
- end
- end
- end
- Refresh();
- end)
- end
- end
- obj60.Parent=gui;
- obj62.MouseButton1Down:connect(function()
- PermissionsIndex=PermissionsIndex-1;
- if PermissionsIndex<1 then PermissionsIndex=#game.Players:GetChildren(); end
- Refresh();
- end)
- obj62.MouseMoved:connect(function(x,y)
- obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
- obj66.Text="Previous Player";
- obj66.Visible=true;
- end)
- obj63.MouseButton1Down:connect(function()
- PermissionsIndex=PermissionsIndex+1;
- if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=1; end
- Refresh();
- end)
- obj63.MouseMoved:connect(function(x,y)
- obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
- obj66.Text="Next Player";
- obj66.Visible=true;
- end)
- obj64.MouseButton1Down:connect(function()
- PermissionsGiven=not PermissionsGiven;
- obj64.Text=PermissionsGiven and "Given" or "Recieved";
- end)
- obj64.MouseMoved:connect(function(x,y)
- obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
- obj66.Text="Currently displaying: " .. (PermissionsGiven and "Permissions given to other players" or "Permissions other players have given you");
- obj66.Visible=true;
- end)
- obj65.MouseButton1Down:connect(function()
- if obj60~=nil then obj60.Parent=nil; end
- end)
- obj62.MouseMoved:connect(function(x,y)
- obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
- obj66.Text="Submit changes and close this window.";
- obj66.Visible=true;
- end)
- Refresh();
- end)
- end
- --[[ Passive ]]
- Shortcuts={
- }
- LastClick=tick();
- Click=1;
- PartClicked=nil;
- SelectedPart=2;
- LassoSelect=false;
- lasso=Instance.new("Frame", gui);
- lasso.BackgroundColor3=Color3.new(.2, .6, 1);
- lasso.BorderColor3=Color3.new(0, 0, 0);
- lasso.BackgroundTransparency=.8;
- lasso.Visible=false;
- function Passive(p)
- c=p[1];
- if c=="KeyDown" then
- keys.down(string.byte(p[3]));
- if string.byte(p[3])==13 then
- TB.enter();
- end
- if p[3]=="r" and not keys.check(48) then
- Drag.Rotate(Enum.Axis.Y);
- elseif p[3]=="t" and not keys.check(48) then
- Drag.Rotate(Enum.Axis.X);
- end
- if p[3]=="z" then
- if keys.check(48) then
- HitButton(gui27);
- else
- HitButton(obj7);
- HitButton(obj4);
- end
- elseif p[3]=="r" then
- if keys.check(48) then
- HitButton(gui28);
- end
- elseif p[3]=="g" then
- if keys.check(48) then
- HitButton(gui24);
- end
- elseif p[3]=="u" then
- if keys.check(48) then
- HitButton(gui25);
- end
- elseif p[3]=="c" then
- if keys.check(48) then
- HitButton(gui29);
- end
- elseif string.byte(p[3])==8 then
- if keys.check(48) then
- HitButton(gui30);
- end
- elseif p[3]=="q" then
- HitButton(obj7);
- HitButton(obj3);
- elseif p[3]=="e" then
- HitButton(obj7);
- HitButton(obj6);
- end
- elseif c=="KeyUp" then
- keys.up(string.byte(p[3]));
- elseif c=="Button1Down" then
- TB.enter();
- if p[2].Target~=nil then
- if tick()-LastClick>Options.DoubleClickSpeed or PartClicked==nil or p[2].Target~=PartClicked then
- if not Selection.Check(p[2].Target) and keys.check(48) and Permission(p[2].Target, "select") then
- Selection.Add(p[2].Target);
- PartClicked=p[2].Target;
- SelectedPart=1;
- elseif Selection.Check(p[2].Target) and keys.check(48) then
- Selection.Remove(p[2].Target);
- PartClicked=p[2].Target;
- SelectedPart=0;
- elseif Selection.Check(p[2].Target) and not keys.check(48) and Permission(p[2].Target, "drag") then
- PartClicked=nil;
- SelectedPart=2;
- Drag.Down(p[2].Target, (p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p, HasPermission(GetParts(Selection.Get()), "drag"));
- if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
- elseif not Selection.Check(p[2].Target) and not keys.check(48) and Permission(p[2].Target, "select") then
- PartClicked=p[2].Target;
- SelectedPart=1;
- Selection.Clear();
- Selection.Add(p[2].Target);
- if Permission(p[2].Target, "drag") then
- Drag.Down(p[2].Target, (p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p, HasPermission(GetParts(Selection.Get()), "drag"));
- end
- if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
- elseif not Selection.Check(p[2].Target) and not p[2].Target.Locked and Permission(p[2].Target, "clone") then
- --clone the part.
- if p[2].Target~=nil then
- local offset=(p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p;
- local k=p[2].Target:clone();
- k.Name="BlobbyblobBuild_"..player.Name;
- if Options.CloneShift then
- x=math.abs((k.CFrame*CFrame.Angles(0,math.pi/2,0)).lookVector:Dot(Vector3.new(0,1,0)));
- y=math.abs((k.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector:Dot(Vector3.new(0,1,0)));
- z=math.abs(k.CFrame.lookVector:Dot(Vector3.new(0,1,0)));
- if (y >= x and y >= z) then
- k.CFrame=CFrame.new(0,k.Size.y,0)*k.CFrame;
- elseif (x >= y and y >= z) then
- k.CFrame=CFrame.new(0,k.Size.x,0)*k.CFrame;
- elseif (z >= x and z >= y) then
- k.CFrame=CFrame.new(0,k.Size.z,0)*k.CFrame;
- end
- end
- k.Parent=workspace;
- History.Action("Clone", {k}, {{k, k.CFrame}}); --send a copy so that if I end up deleting it (via undo), I can pull up another copy.
- Selection.Clear();
- Selection.Add(k);
- Drag.Down(k, offset, {k});
- if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
- end
- else
- Selection.Clear();
- lasso.Size=UDim2.new(0,0,0,0);
- PartClicked=nil;
- lasso.Visible=true;
- start_pos=Vector2.new(p[2].X, p[2].Y);
- local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
- slope1=Vector2.new(rel.x/-rel.z, rel.y/-rel.z)
- LassoSelect=true;
- end
- Click=1;
- else
- --A double click! :o
- Click=Click+1;
- if SelectedPart==1 and PartClicked~=nil then
- Targ=PartClicked;
- i=1; while i<Click and Targ.Parent~=workspace do i=i+1; Targ=Targ.Parent; end
- Selection.Add(Targ);
- elseif SelectedPart==0 then
- Targ=PartClicked;
- for i=2,Click do Targ=Targ.Parent; end
- Selection.Remove(Targ);
- end
- end
- else
- lasso.Size=UDim2.new(0,0,0,0);
- lasso.Visible=true;
- start_pos=Vector2.new(p[2].X, p[2].Y);
- local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
- slope1=Vector2.new(rel.x/-rel.z, rel.y/-rel.z)
- LassoSelect=true;
- Selection.Clear();
- Click=1;
- PartClicked=nil;
- end
- LastClick=tick();
- elseif c=="Move" then
- Drag.Move(p[2].UnitRay);
- if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
- if lasso.Visible then
- lasso.Position=UDim2.new(0, math.min(p[2].X, start_pos.x), 0, math.min(p[2].Y, start_pos.y));
- lasso.Size=UDim2.new(0, math.abs(p[2].X-start_pos.x), 0, math.abs(p[2].Y-start_pos.y));
- end
- elseif c=="Button1Up" then
- Drag.Up();
- p[2].Icon=GetIcon(p[2].Target);
- if LassoSelect then
- lasso.Visible=false;
- LassoSelect=false;
- local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
- search(slope1, Vector2.new(rel.x/-rel.z, rel.y/-rel.z), p[2]);
- end
- elseif c=="Undo" then
- History.Undo();
- elseif c=="Redo" then
- History.Redo();
- elseif c=="Group" then
- if #Selection.Get()>1 then
- local max_parent=Selection.Get()[1];
- local g=Instance.new("Model");
- for i,v in pairs(Selection.Get()) do
- if v.Parent:IsAncestorOf(max_parent) then
- max_parent = v.Parent;
- end
- v.Parent=g;
- end
- g.Parent=max_parent;
- Selection.Clear();
- Selection.Add(g);
- end
- elseif c=="Ungroup" then
- for i,v in pairs(Selection.Get()) do
- if v:IsA("Model") then
- for a,b in pairs(v:GetChildren()) do
- b.Parent=v.Parent;
- Selection.Add(b);
- end
- v.Parent=nil;
- Selection.Remove(v);
- end
- end
- elseif c=="Delete" then
- parents={};
- items=HasPermission(GetParts(Selection.Get()), "delete");
- for i,v in pairs(items) do
- Selection.Remove(v);
- parents[#parents+1]=v.Parent;
- v.Parent=nil;
- end
- History.Action("Delete", items, parents);
- elseif c=="Clone" then
- local items={};
- local refs={};
- upward=0;
- if Options.CloneShift then
- for i,p in pairs(GetParts(Selection.Get())) do
- x=math.abs((p.CFrame*CFrame.Angles(0,math.pi/2,0)).lookVector:Dot(Vector3.new(0,1,0)));
- y=math.abs((p.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector:Dot(Vector3.new(0,1,0)));
- z=math.abs(p.CFrame.lookVector:Dot(Vector3.new(0,1,0)));
- if (y >= x and y >= z) then
- upward=math.max(upward, p.Size.y);
- elseif (x >= y and x >= z) then
- upward=math.max(upward, p.Size.x);
- elseif (z >= x and z >= y) then
- upward=math.max(upward, p.Size.z);
- end
- end
- end
- for i,v in pairs(Selection.Get()) do
- local p=v:clone();
- p.Parent=workspace;
- items[#items+1]=p;
- end
- for i,v in pairs(GetParts(items)) do
- v.CFrame = CFrame.new(0, upward, 0) * v.CFrame;
- v.Name="BlobbyblobBuild_"..player.Name;
- refs[#refs+1]={v, v.CFrame};
- end
- Selection.Clear()
- for i,v in pairs(items) do
- Selection.Add(v);
- end
- History.Action("Clone", items, refs);
- elseif c=="Save" then
- local s=script:findFirstChild("Save");
- if s~=nil then
- local s=s:clone();
- s.Disabled=false;
- s.Parent=game.Players.LocalPlayer.Backpack;
- end
- end
- local round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end
- --Almost a function: Refresh Dock.
- if Options.DockVisible then
- gui1.Visible=true;
- if #GetParts(Selection.Get())==1 then
- part=GetParts(Selection.Get())[1];
- local x,y,z,r00,r01,r02,r10,r11,r12,r20,r21,r22=part.CFrame:components();
- gui2.Text=round(x, 1e-6);
- gui4.Text=round(y, 1e-6);
- gui5.Text=round(z, 1e-6);
- gui7.Text=part.Size.x;
- gui8.Text=part.Size.y;
- gui9.Text=part.Size.z;
- gui11.Text=round(r00, 1e-5);
- gui12.Text=round(r01, 1e-5);
- gui13.Text=round(r02, 1e-5);
- gui14.Text=round(r10, 1e-5);
- gui15.Text=round(r11, 1e-5);
- gui16.Text=round(r12, 1e-5);
- gui17.Text=round(r20, 1e-5);
- gui18.Text=round(r21, 1e-5);
- gui19.Text=round(r22, 1e-5);
- x,y,z=part.CFrame:toEulerAnglesXYZ();
- gui21.Text=round(math.deg(x), 1e-5);
- gui22.Text=round(math.deg(y), 1e-5);
- gui23.Text=round(math.deg(z), 1e-5);
- else
- gui2.Text="";
- gui4.Text="";
- gui5.Text="";
- gui7.Text="";
- gui8.Text="";
- gui9.Text="";
- gui11.Text="";
- gui12.Text="";
- gui13.Text="";
- gui14.Text="";
- gui15.Text="";
- gui16.Text="";
- gui17.Text="";
- gui18.Text="";
- gui19.Text="";
- gui21.Text="";
- gui22.Text="";
- gui23.Text="";
- end
- else
- gui1.Visible=false
- end
- end
- --The two following functions were made by weaselman50. Don't ask me how they work. :P
- function check(rel, slope1, slope2, Axis)
- if rel[Axis]>slope2[Axis]*-rel.z and slope1[Axis]>slope2[Axis] then
- return rel[Axis]<slope1[Axis]*-rel.z
- elseif slope1[Axis]<slope2[Axis] and rel[Axis]<slope2[Axis]*-rel.z then
- return rel[Axis]>slope1[Axis]*-rel.z
- else
- return false
- end
- end
- function search(slope1, slope2, mouse)
- print("Search called");
- print("Slope1: ", slope1, " - Slope2: ", slope2);
- parts=HasPermission(GetParts(workspace:GetChildren()), "select");
- for i, v in pairs(parts) do
- local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(v.Position)).p
- if rel.z<0 and check(rel, slope1, slope2, "x") and check(rel, slope1, slope2, "y") then
- Selection.Add(v)
- end
- end
- end
- function Permission(part,case)
- if OnlineMode then
- if #part.Name>16 and string.sub(part.Name,1,16)=="BlobbyblobBuild_" then
- local owner=game.Players:findFirstChild(string.sub(part.Name,17))
- if not owner then
- if case~="select" or not part.Locked or (keys.check(51) or keys.check(52)) then
- return true; --player left the game
- end
- else
- local bp=owner:findFirstChild("BuildPermissions");
- if bp~=nil then
- if bp:findFirstChild(player.Name.."_"..case) then
- if bp[player.Name.."_"..case].Value then
- if case~="select" or not part.Locked or (keys.check(51) or keys.check(52)) then
- return true; --player gave permission
- end
- end
- end
- end
- end
- elseif not part.Locked and case=="clone" then
- return true --return true for cloning a starter part
- end
- else
- --for offline build, return true for everything except selecting and dragging locked parts (without alt selected).
- if case=="drag" or case=="select" then
- if (keys.check(51) or keys.check(52)) or not part.Locked then
- return true
- else
- return false
- end
- else
- return true
- end
- end
- return false;
- end
- function HasPermission(table_of_parts, case)
- local t={};
- for i,v in pairs(table_of_parts) do
- if Permission(v,case) then
- t[#t+1]=v;
- end
- end
- return t;
- end
- function UserPermission(LocalUser, TargetUser, case)
- local bp=TargetUser:findFirstChild("BuildPermissions");
- if bp~=nil then
- if bp:findFirstChild(LocalUser.Name.."_"..case) then
- if bp[LocalUser.Name.."_"..case].Value then
- return true; --player gave permission
- end
- end
- end
- end
- _possible_permissions={"select","drag","clone","handles_drag","move","handles_resize","resize","handles_rotate","rotate","lock","color","material","transparency","reflectance","anchor","cancollide","formfactor","shape","surface","velocity","rotvelocity","friction","delete","save", "elasticity","owner_only"}
- --Give all permissions to every player for themself.
- if player:findFirstChild("BuildPermissions")==nil then
- local m=Instance.new("Model");
- m.Name="BuildPermissions";
- for i,v in pairs(_possible_permissions) do
- local q=Instance.new("BoolValue");
- q.Name=player.Name.."_"..v;
- q.Value=true;
- q.Parent=m;
- end
- m.Parent=player;
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Reflectance()
- function Active(p)
- local c=p[1];
- if c=="Unload" then
- obj40.Parent=nil;
- TB.remove(obj41);
- FunctionData.Reflectance.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- Spawn(function()
- local t = tab_index;
- wait(Options.RepeatDelay);
- while keys.check(9) and t==tab_index do
- HitButton(gui26);
- wait(Options.RepeatRate);
- end
- end);
- end
- Passive(p);
- return;
- elseif c=="KeyUp" then
- if string.byte(p[3])==9 then
- tab_index = tab_index + 1;
- end
- Passive(p);
- elseif c=="Apply" then
- prior={};
- after={};
- parts=HasPermission(GetParts(Selection.Get()), "reflectance");
- FunctionData.Reflectance.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
- for i,v in pairs(parts) do
- prior[i]=v.Reflectance;
- if FunctionData.Reflectance.Relative then
- v.Reflectance=math.min(1e8, math.max(0, v.Reflectance+FunctionData.Reflectance.Value));
- else
- v.Reflectance=math.min(1e8, math.max(0, FunctionData.Reflectance.Value));
- end
- after[i]=v.Reflectance;
- end
- pass_action=false;
- for i,v in pairs(prior) do
- if prior[i]~=after[i] then
- pass_action=true;
- end
- end
- if pass_action then
- History.Action("Reflectance", parts, prior, after);
- end
- return;
- else
- Passive(p);
- end
- end
- tab_index=0;
- FunctionData.Reflectance = FunctionData.Reflectance or {};
- FunctionData.Reflectance.Relative = FunctionData.Reflectance.Relative or false;
- FunctionData.Reflectance.Value = FunctionData.Reflectance.Value or 0.5;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(214/255,246/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Reflectance" obj40.Position=UDim2.new(0,243,1,-40) obj40.Size=UDim2.new(0,84,0,40)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="tBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(227/255,227/255,227/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="tButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text=".5" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="RelativeConstant" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,22) obj43.Size=UDim2.new(0,80,0,16) obj43.Text="Constant" obj43.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text = tostring(FunctionData.Reflectance.Value);
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- function RefreshButtons()
- obj43.Text = FunctionData.Reflectance.Relative and "Relative" or "Constant";
- end
- obj43.MouseButton1Down:connect(function()
- FunctionData.Reflectance.Relative = not FunctionData.Reflectance.Relative;
- RefreshButtons();
- end)
- RefreshButtons();
- end
- function PaletteFunctions.Resize()
- function Active(p)
- local c=p[1];
- if c=="Button1Down" then
- handles.Visible=false;
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- Passive(p);
- UpdateHandles();
- elseif c=="Button1Up" then
- handles.Visible=true;
- axes_x.Parent=LocalBin;
- axes_y.Parent=LocalBin;
- axes_z.Parent=LocalBin;
- HandlesUp();
- Passive(p);
- UpdateHandles();
- elseif c=="Unload" then
- obj40.Parent=nil;
- TB.remove(obj41);
- TB.remove(obj43);
- TB.remove(obj45);
- handles.Parent=nil;
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- elseif c=="Apply" then
- FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- p=HasPermission(GetParts(Selection.Get()), "resize");
- pre_size={};
- post_size={};
- for i,v in pairs(p) do
- pre_size[i]=v.Size;
- local cf = v.CFrame;
- v.Size = v.Size + Vector3.new(FunctionData.Resize.x, FunctionData.Resize.y, FunctionData.Resize.z);
- v.CFrame = cf;
- post_size[i]=v.Size;
- end
- History.Action("Resize", p, pre_size, post_size);
- Passive(p);
- UpdateHandles();
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- Spawn(function()
- local t = tab_index;
- wait(Options.RepeatDelay);
- while keys.check(9) and t==tab_index do
- HitButton(gui26);
- wait(Options.RepeatRate);
- end
- end);
- end
- Passive(p);
- UpdateHandles();
- else
- Passive(p);
- end
- end
- FunctionData.Resize=FunctionData.Resize or {};
- FunctionData.Resize.x = FunctionData.Resize.x or 0;
- FunctionData.Resize.y = FunctionData.Resize.y or 0;
- FunctionData.Resize.z = FunctionData.Resize.z or 0;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(211/255,243/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Resize" obj40.Position=UDim2.new(0,243,1,-78) obj40.Size=UDim2.new(0,84,0,78)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="xBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="X" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,85/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="xButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text="X" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextBox") obj43.BackgroundColor3=Color3.new(0/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="yBox" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,22) obj43.Size=UDim2.new(0,80,0,18) obj43.Text="Y" obj43.TextColor3=Color3.new(27/255,42/255,53/255) obj43.Visible=false obj43.ZIndex=2
- obj44=Instance.new("TextButton") obj44.BackgroundColor3=Color3.new(155/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Name="yButton" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,22) obj44.Size=UDim2.new(0,80,0,18) obj44.Text="Y" obj44.TextColor3=Color3.new(27/255,42/255,53/255)
- obj45=Instance.new("TextBox") obj45.BackgroundColor3=Color3.new(255/255,0/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Name="zBox" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,42) obj45.Size=UDim2.new(0,80,0,18) obj45.Text="Z" obj45.TextColor3=Color3.new(27/255,42/255,53/255) obj45.Visible=false obj45.ZIndex=2
- obj46=Instance.new("TextButton") obj46.BackgroundColor3=Color3.new(255/255,147/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Name="zButton" obj46.Parent=obj40 obj46.Position=UDim2.new(0,2,0,42) obj46.Size=UDim2.new(0,80,0,18) obj46.Text="Z" obj46.TextColor3=Color3.new(27/255,42/255,53/255)
- obj47=Instance.new("TextButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Name="Neg" obj47.Parent=obj40 obj47.Position=UDim2.new(0,2,0,62) obj47.Size=UDim2.new(0,25,0,14) obj47.Text="* -1" obj47.TextColor3=Color3.new(27/255,42/255,53/255)
- obj48=Instance.new("TextButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Name="Doub" obj48.Parent=obj40 obj48.Position=UDim2.new(0,29,0,62) obj48.Size=UDim2.new(0,26,0,14) obj48.Text="* 2" obj48.TextColor3=Color3.new(27/255,42/255,53/255)
- obj49=Instance.new("TextButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Name="Half" obj49.Parent=obj40 obj49.Position=UDim2.new(0,57,0,62) obj49.Size=UDim2.new(0,25,0,14) obj49.Text="* .5" obj49.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text = FunctionData.Resize.x;
- obj44.Text = FunctionData.Resize.y;
- obj46.Text = FunctionData.Resize.z;
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- TB.insert(obj43, obj44);
- TB.insert(obj45, obj46);
- obj42.Text=FunctionData.Resize.x;
- obj44.Text=FunctionData.Resize.y;
- obj46.Text=FunctionData.Resize.z;
- obj47.MouseButton1Down:connect(function()
- FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Resize.x = (FunctionData.Resize.x or 0) * -1;
- FunctionData.Resize.y = (FunctionData.Resize.y or 0) * -1;
- FunctionData.Resize.z = (FunctionData.Resize.z or 0) * -1;
- obj42.Text = FunctionData.Resize.x;
- obj44.Text = FunctionData.Resize.y;
- obj46.Text = FunctionData.Resize.z;
- end)
- obj48.MouseButton1Down:connect(function()
- FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Resize.x = (FunctionData.Resize.x or 0) * 2;
- FunctionData.Resize.y = (FunctionData.Resize.y or 0) * 2;
- FunctionData.Resize.z = (FunctionData.Resize.z or 0) * 2;
- obj42.Text = FunctionData.Resize.x;
- obj44.Text = FunctionData.Resize.y;
- obj46.Text = FunctionData.Resize.z;
- end)
- obj49.MouseButton1Down:connect(function()
- FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Resize.x = (FunctionData.Resize.x or 0) * .5;
- FunctionData.Resize.y = (FunctionData.Resize.y or 0) * .5;
- FunctionData.Resize.z = (FunctionData.Resize.z or 0) * .5;
- obj42.Text = FunctionData.Resize.x;
- obj44.Text = FunctionData.Resize.y;
- obj46.Text = FunctionData.Resize.z;
- end)
- axes_x=Instance.new("Part");
- axes_x.Anchored=true;
- axes_x.CanCollide=false;
- axes_x.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_x;
- axes_x.Name="axes_x";
- axes_x.formFactor=0;
- axes_x.Size=Vector3.new(1, 3, 1);
- axes_x.BrickColor=BrickColor.new("Bright yellow");
- axes_x.Parent=LocalBin;
- axes_y=Instance.new("Part");
- axes_y.Anchored=true;
- axes_y.CanCollide=false;
- axes_y.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_y;
- axes_y.Name="axes_y";
- axes_y.formFactor=0;
- axes_y.Size=Vector3.new(1, 3, 1);
- axes_y.BrickColor=BrickColor.new("Cyan");
- axes_y.Parent=LocalBin;
- axes_z=Instance.new("Part");
- axes_z.Anchored=true;
- axes_z.CanCollide=false;
- axes_z.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_z;
- axes_z.Name="axes_z";
- axes_z.formFactor=0;
- axes_z.Size=Vector3.new(1, 3, 1);
- axes_z.BrickColor=BrickColor.new("Magenta");
- axes_z.Parent=LocalBin;
- handles=Instance.new("Handles");
- handles.Color=Options.ResizeHandlesColor;
- handles.Parent=obj1;
- function HandlesUp()
- if resize_drag~=nil then
- History.Action("Move+Resize", resize_drag, original_location, resize_drag.CFrame, original_size, resize_drag.Size);
- original_locations={};
- UpdateHandles();
- end
- end;
- resize_drag=nil;
- old_distance=0;
- original_location=CFrame.new();
- original_size=CFrame.new();
- handles.MouseButton1Down:connect(function()
- p=HasPermission(GetParts(Selection.Get()), "handles_resize");
- if #p==1 then
- resize_drag=p[1];
- original_location=resize_drag.CFrame;
- original_size=resize_drag.Size;
- old_distance = 0;
- end
- end)
- handles.MouseButton1Up:connect(HandlesUp)
- handles.MouseDrag:connect(function(face, dist)
- new_distance = round(dist - old_distance, Options.ResizeDragIntervals);
- old_distance = old_distance + new_distance;
- if new_distance~=0 then
- local faces=Vector3.new();
- if face==Enum.NormalId.Left then
- faces=Vector3.new(-1, 0, 0); -- -
- elseif face==Enum.NormalId.Right then
- faces=Vector3.new(1, 0, 0); -- +
- elseif face==Enum.NormalId.Top then
- faces=Vector3.new(0, 1, 0); -- +
- elseif face==Enum.NormalId.Bottom then
- faces=Vector3.new(0, -1, 0); -- -
- elseif face==Enum.NormalId.Front then
- faces=Vector3.new(0, 0, -1); -- -
- elseif face==Enum.NormalId.Back then
- faces=Vector3.new(0, 0, 1); -- +
- end
- if math.abs(faces.x)==1 then
- new_distance=math.max(-resize_drag.Size.x+Options.SmallestSize.x, new_distance);
- elseif math.abs(faces.y)==1 then
- new_distance=math.max(-resize_drag.Size.y+Options.SmallestSize.y, new_distance);
- elseif math.abs(faces.z)==1 then
- new_distance=math.max(-resize_drag.Size.z+Options.SmallestSize.z, new_distance);
- end
- cf=resize_drag.CFrame;
- resize_drag.Size = resize_drag.Size + Vector3.new(math.abs(faces.x), math.abs(faces.y), math.abs(faces.z)) * new_distance;
- resize_drag.CFrame=cf * CFrame.new(faces * new_distance / 2);
- UpdateHandles();
- end
- end)
- function UpdateHandles()
- p=HasPermission(GetParts(Selection.Get()), "handles_resize");
- if #p==1 then
- handles.Adornee=p[1];
- if Options.ThreeAxes then
- axes_x.Transparency=0;
- axes_y.Transparency=0;
- axes_z.Transparency=0;
- axes_x.CFrame=p[1].CFrame*CFrame.Angles(0, 0, -math.pi/2)*CFrame.new(0, p[1].Size.x/2+axes_x.Size.y/2,0);
- axes_y.CFrame=p[1].CFrame*CFrame.new(0, p[1].Size.y/2+axes_y.Size.y/2,0);
- axes_z.CFrame=p[1].CFrame*CFrame.Angles(math.pi/2, 0, 0)*CFrame.new(0, p[1].Size.z/2+axes_x.Size.y/2,0);
- end
- else
- handles.Adornee=nil;
- axes_x.Transparency=1;
- axes_y.Transparency=1;
- axes_z.Transparency=1;
- end
- end
- round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
- UpdateHandles();
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.RotVelocity()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- FunctionData.RotVelocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.RotVelocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.RotVelocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- obj40.Parent=nil;
- TB.remove(obj41);
- TB.remove(obj43);
- TB.remove(obj45);
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- FunctionData.RotVelocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.RotVelocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.RotVelocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- print(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z);
- local prior={};
- parts=HasPermission(GetParts(Selection.Get()), "rotvelocity");
- for i,v in pairs(parts) do
- prior[i]=v.RotVelocity;
- v.RotVelocity=Vector3.new(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z);
- end
- History.Action("RotVelocity", parts, prior, Vector3.new(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z));
- return;
- else
- Passive(p);
- end
- end
- FunctionData.RotVelocity = FunctionData.RotVelocity or {};
- FunctionData.RotVelocity.x = FunctionData.RotVelocity.x or 0;
- FunctionData.RotVelocity.y = FunctionData.RotVelocity.y or 0;
- FunctionData.RotVelocity.z = FunctionData.RotVelocity.z or 0;
- obj40=Instance.new("Frame"); obj40.BackgroundColor3=Color3.new(213/255,245/255,255/255); obj40.BorderColor3=Color3.new(27/255,42/255,53/255); obj40.Name="RotVelocity"; obj40.Position=UDim2.new(0,243,1,-62); obj40.Size=UDim2.new(0,84,0,62);
- obj41=Instance.new("TextBox"); obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255); obj41.BorderColor3=Color3.new(27/255,42/255,53/255); obj41.Name="xBox"; obj41.Parent=obj40; obj41.Position=UDim2.new(0,2,0,2); obj41.Size=UDim2.new(0,80,0,18); obj41.Text="X"; obj41.TextColor3=Color3.new(27/255,42/255,53/255); obj41.Visible=false; obj41.ZIndex=2;
- obj42=Instance.new("TextButton"); obj42.BackgroundColor3=Color3.new(255/255,255/255,85/255); obj42.BorderColor3=Color3.new(27/255,42/255,53/255); obj42.Name="xButton"; obj42.Parent=obj40; obj42.Position=UDim2.new(0,2,0,2); obj42.Size=UDim2.new(0,80,0,18); obj42.Text="X"; obj42.TextColor3=Color3.new(27/255,42/255,53/255);
- obj43=Instance.new("TextBox"); obj43.BackgroundColor3=Color3.new(0/255,255/255,255/255); obj43.BorderColor3=Color3.new(27/255,42/255,53/255); obj43.Name="yBox"; obj43.Parent=obj40; obj43.Position=UDim2.new(0,2,0,22); obj43.Size=UDim2.new(0,80,0,18); obj43.Text="Y"; obj43.TextColor3=Color3.new(27/255,42/255,53/255); obj43.Visible=false; obj43.ZIndex=2;
- obj44=Instance.new("TextButton"); obj44.BackgroundColor3=Color3.new(157/255,255/255,255/255); obj44.BorderColor3=Color3.new(27/255,42/255,53/255); obj44.Name="yButton"; obj44.Parent=obj40; obj44.Position=UDim2.new(0,2,0,22); obj44.Size=UDim2.new(0,80,0,18); obj44.Text="Y"; obj44.TextColor3=Color3.new(27/255,42/255,53/255);
- obj45=Instance.new("TextBox"); obj45.BackgroundColor3=Color3.new(255/255,0/255,255/255); obj45.BorderColor3=Color3.new(27/255,42/255,53/255); obj45.Name="zBox"; obj45.Parent=obj40; obj45.Position=UDim2.new(0,2,0,42); obj45.Size=UDim2.new(0,80,0,18); obj45.Text="Z"; obj45.TextColor3=Color3.new(27/255,42/255,53/255); obj45.Visible=false; obj45.ZIndex=2;
- obj46=Instance.new("TextButton"); obj46.BackgroundColor3=Color3.new(255/255,149/255,255/255); obj46.BorderColor3=Color3.new(27/255,42/255,53/255); obj46.Name="zButton"; obj46.Parent=obj40; obj46.Position=UDim2.new(0,2,0,42); obj46.Size=UDim2.new(0,80,0,18); obj46.Text="Z"; obj46.TextColor3=Color3.new(27/255,42/255,53/255);
- obj42.Text=FunctionData.RotVelocity.x;
- obj44.Text=FunctionData.RotVelocity.y;
- obj46.Text=FunctionData.RotVelocity.z;
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- TB.insert(obj43, obj44);
- TB.insert(obj45, obj46);
- end
- function PaletteFunctions.Rotate()
- tab_index = 0;
- function Active(p)
- local c=p[1];
- if c=="Button1Down" then
- if pending_selection then
- FunctionData.Rotate.Around = p[2].Target;
- pending_selection = false;
- sb.Visible=false;
- HandlesUp();
- UpdateButtons();
- UpdateHandles();
- else
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- aabb.Parent=nil;
- handles.Visible=false;
- Passive(p);
- UpdateHandles();
- end
- elseif c=="Button1Up" then
- HandlesUp();
- axes_x.Parent=LocalBin;
- axes_y.Parent=LocalBin;
- axes_z.Parent=LocalBin;
- aabb.Parent=LocalBin;
- Passive(p);
- UpdateHandles();
- elseif c=="Unload" then
- FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- obj40.Parent=nil;
- handles.Parent=nil;
- sb.Parent=nil;
- axes_x.Parent=nil;
- axes_y.Parent=nil;
- axes_z.Parent=nil;
- aabb.Parent=nil;
- Passive(p);
- elseif c=="Apply" then
- FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- if FunctionData.Rotate.x~=0 or FunctionData.Rotate.y~=0 or FunctionData.Rotate.z~=0 then
- p=HasPermission(GetParts(Selection.Get()), "rotate");
- old_cframe={}; for i,v in pairs(p) do old_cframe[#old_cframe+1]=v.CFrame; end
- if FunctionData.Rotate.Around and FunctionData.Rotate.WorldAxis then
- center=CFrame.new(FunctionData.Rotate.Around.Position);
- origin={};
- for i,v in pairs(p) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z))
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- elseif FunctionData.Rotate.Around and not FunctionData.Rotate.WorldAxis then
- center=FunctionData.Rotate.Around.CFrame;
- origin={};
- for i,v in pairs(p) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- elseif FunctionData.Rotate.AsWhole then
- center = Vector3.new();
- for i,v in pairs(p) do
- center = center + v.Position;
- end
- center = CFrame.new(center / #p);
- origin={};
- for i,v in pairs(p) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- elseif FunctionData.Rotate.Constant then
- for i,v in pairs(p) do
- v.CFrame = CFrame.new(v.CFrame.p)*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
- end
- elseif FunctionData.Rotate.WorldAxis then
- for i,v in pairs(p) do
- v.CFrame = CFrame.new(v.CFrame.p) * CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z)) * (v.CFrame - v.Position);
- end
- else
- for i,v in pairs(p) do
- v.CFrame = v.CFrame * CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
- end
- end
- new_cframe={}; for i,v in pairs(p) do new_cframe[#new_cframe+1]=v.CFrame; end
- History.Action("Rotate", p, old_cframe, new_cframe);
- end
- Passive(p);
- UpdateHandles();
- elseif c=="Move" then
- if pending_selection then
- sb.Adornee = p[2].Target;
- end
- Passive(p);
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- Spawn(function()
- local t = tab_index;
- wait(Options.RepeatDelay);
- while keys.check(9) and t==tab_index do
- HitButton(gui26);
- wait(Options.RepeatRate);
- end
- end);
- tab_index = tab_index + 1;
- end
- Passive(p);
- UpdateHandles();
- else
- Passive(p);
- end
- end
- FunctionData.Rotate=FunctionData.Rotate or {};
- FunctionData.Rotate.x = FunctionData.Rotate.x or 0;
- FunctionData.Rotate.y = FunctionData.Rotate.y or 0;
- FunctionData.Rotate.z = FunctionData.Rotate.z or 0;
- if FunctionData.Rotate.WorldAxis==nil then
- FunctionData.Rotate.WorldAxis = false;
- end
- if FunctionData.Rotate.AsWhole==nil then
- FunctionData.Rotate.AsWhole = true;
- end
- if FunctionData.Rotate.Constant==nil then
- FunctionData.Rotate.Constant = false;
- end
- FunctionData.Rotate.Around = FunctionData.Rotate.Around;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(211/255,243/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Rotate" obj40.Position=UDim2.new(0,243,1,-142) obj40.Size=UDim2.new(0,84,0,142)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="xBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="X" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,85/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="xButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text="X" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextBox") obj43.BackgroundColor3=Color3.new(0/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="yBox" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,22) obj43.Size=UDim2.new(0,80,0,18) obj43.Text="Y" obj43.TextColor3=Color3.new(27/255,42/255,53/255) obj43.Visible=false obj43.ZIndex=2
- obj44=Instance.new("TextButton") obj44.BackgroundColor3=Color3.new(155/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Name="yButton" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,22) obj44.Size=UDim2.new(0,80,0,18) obj44.Text="Y" obj44.TextColor3=Color3.new(27/255,42/255,53/255)
- obj45=Instance.new("TextBox") obj45.BackgroundColor3=Color3.new(255/255,0/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Name="zBox" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,42) obj45.Size=UDim2.new(0,80,0,18) obj45.Text="Z" obj45.TextColor3=Color3.new(27/255,42/255,53/255) obj45.Visible=false obj45.ZIndex=2
- obj46=Instance.new("TextButton") obj46.BackgroundColor3=Color3.new(255/255,147/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Name="zButton" obj46.Parent=obj40 obj46.Position=UDim2.new(0,2,0,42) obj46.Size=UDim2.new(0,80,0,18) obj46.Text="Z" obj46.TextColor3=Color3.new(27/255,42/255,53/255)
- obj47=Instance.new("TextButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Name="WorldObjAxis" obj47.Parent=obj40 obj47.Position=UDim2.new(0,2,0,62) obj47.Size=UDim2.new(0,80,0,14) obj47.Text="World Axis" obj47.TextColor3=Color3.new(27/255,42/255,53/255)
- obj48=Instance.new("TextButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Name="Neg" obj48.Parent=obj40 obj48.Position=UDim2.new(0,2,1,-16) obj48.Size=UDim2.new(0,25,0,14) obj48.Text="* -1" obj48.TextColor3=Color3.new(27/255,42/255,53/255)
- obj49=Instance.new("TextButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Name="Doub" obj49.Parent=obj40 obj49.Position=UDim2.new(0,29,1,-16) obj49.Size=UDim2.new(0,26,0,14) obj49.Text="* 2" obj49.TextColor3=Color3.new(27/255,42/255,53/255)
- obj50=Instance.new("TextButton") obj50.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj50.BorderColor3=Color3.new(27/255,42/255,53/255) obj50.Name="Half" obj50.Parent=obj40 obj50.Position=UDim2.new(0,57,1,-16) obj50.Size=UDim2.new(0,25,0,14) obj50.Text="* .5" obj50.TextColor3=Color3.new(27/255,42/255,53/255)
- obj51=Instance.new("TextButton") obj51.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj51.BorderColor3=Color3.new(27/255,42/255,53/255) obj51.Name="AsWholeIndivid" obj51.Parent=obj40 obj51.Position=UDim2.new(0,2,0,78) obj51.Size=UDim2.new(0,80,0,14) obj51.Text="As Whole" obj51.TextColor3=Color3.new(27/255,42/255,53/255)
- obj52=Instance.new("TextButton") obj52.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj52.BorderColor3=Color3.new(27/255,42/255,53/255) obj52.Name="Constant" obj52.Parent=obj40 obj52.Position=UDim2.new(0,2,0,94) obj52.Size=UDim2.new(0,80,0,14) obj52.Text="Constant" obj52.TextColor3=Color3.new(27/255,42/255,53/255)
- obj53=Instance.new("TextButton") obj53.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj53.BorderColor3=Color3.new(27/255,42/255,53/255) obj53.Name="Constant" obj53.Parent=obj40 obj53.Position=UDim2.new(0,2,0,110) obj53.Size=UDim2.new(0,80,0,14) obj53.Text="Around Point" obj53.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- TB.insert(obj43, obj44);
- TB.insert(obj45, obj46);
- obj42.Text=FunctionData.Rotate.x;
- obj44.Text=FunctionData.Rotate.y;
- obj46.Text=FunctionData.Rotate.z;
- function UpdateButtons()
- if FunctionData.Rotate.Around~=nil then
- obj47.BackgroundColor3=Options.ButtonColor;
- obj51.BackgroundColor3=Options.InactiveColor;
- obj52.BackgroundColor3=Options.InactiveColor;
- obj53.BackgroundColor3=Options.ButtonColor;
- obj47.Text = FunctionData.Rotate.WorldAxis and "World Axis" or "Centroid Axis";
- obj51.Text = "As Whole";
- obj52.Text = "Relative";
- obj53.Text = "Around Part";
- elseif FunctionData.Rotate.AsWhole then
- obj47.BackgroundColor3=Options.InactiveColor;
- obj51.BackgroundColor3=Options.ButtonColor;
- obj52.BackgroundColor3=Options.InactiveColor;
- obj53.BackgroundColor3=Options.ButtonColor;
- obj47.Text = "World Axis";
- obj51.Text = "As Whole";
- obj52.Text = "Relative";
- obj53.Text = "Around nil";
- elseif FunctionData.Rotate.Constant then
- obj47.BackgroundColor3=Options.InactiveColor;
- obj51.BackgroundColor3=Options.InactiveColor;
- obj52.BackgroundColor3=Options.ButtonColor;
- obj53.BackgroundColor3=Options.InactiveColor;
- obj47.Text = "World Axis";
- obj51.Text = "Individually";
- obj52.Text = "Constant";
- obj53.Text = "Around nil";
- else
- obj47.BackgroundColor3=Options.ButtonColor;
- obj51.BackgroundColor3=Options.ButtonColor;
- obj52.BackgroundColor3=Options.ButtonColor;
- obj53.BackgroundColor3=Options.ButtonColor;
- obj47.Text = FunctionData.Rotate.WorldAxis and "World Axis" or "Object's Axis";
- obj51.Text = "Individually";
- obj52.Text = "Relative";
- obj53.Text = "Around nil";
- end
- end
- UpdateButtons();
- obj47.MouseButton1Down:connect(function()
- FunctionData.Rotate.WorldAxis = not FunctionData.Rotate.WorldAxis;
- UpdateButtons();
- UpdateHandles();
- end)
- obj51.MouseButton1Down:connect(function()
- FunctionData.Rotate.AsWhole = not FunctionData.Rotate.AsWhole;
- UpdateButtons();
- UpdateHandles();
- end)
- obj52.MouseButton1Down:connect(function()
- FunctionData.Rotate.Constant = not FunctionData.Rotate.Constant;
- UpdateButtons();
- UpdateHandles();
- end)
- pending_selection = false;
- sb=Instance.new("SelectionBox");
- sb.Color=Options.ActiveSelectionBoxColor;
- sb.Name="PendingDistinguisher";
- sb.Visible=false;
- sb.Parent=obj1;
- obj53.MouseButton1Down:connect(function()
- if not pending_selection then
- pending_selection = true;
- sb.Visible=true;
- else
- pending_selection = false;
- sb.Visible=false;
- FunctionData.Rotate.Around = nil;
- end
- UpdateButtons();
- end)
- obj48.MouseButton1Down:connect(function()
- FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * -1;
- FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * -1;
- FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * -1;
- obj42.Text = FunctionData.Rotate.x;
- obj44.Text = FunctionData.Rotate.y;
- obj46.Text = FunctionData.Rotate.z;
- end)
- obj49.MouseButton1Down:connect(function()
- FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * 2;
- FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * 2;
- FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * 2;
- obj42.Text = FunctionData.Rotate.x;
- obj44.Text = FunctionData.Rotate.y;
- obj46.Text = FunctionData.Rotate.z;
- end)
- obj50.MouseButton1Down:connect(function()
- FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * .5;
- FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * .5;
- FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * .5;
- obj42.Text = FunctionData.Rotate.x;
- obj44.Text = FunctionData.Rotate.y;
- obj46.Text = FunctionData.Rotate.z;
- end)
- axes_x=Instance.new("Part");
- axes_x.Anchored=true;
- axes_x.CanCollide=false;
- axes_x.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_x;
- axes_x.Name="axes_x";
- axes_x.formFactor=0;
- axes_x.Size=Vector3.new(1, 3, 1);
- axes_x.BrickColor=BrickColor.new("Bright yellow");
- axes_x.Parent=LocalBin;
- axes_y=Instance.new("Part");
- axes_y.Anchored=true;
- axes_y.CanCollide=false;
- axes_y.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_y;
- axes_y.Name="axes_x";
- axes_y.formFactor=0;
- axes_y.Size=Vector3.new(1, 3, 1);
- axes_y.BrickColor=BrickColor.new("Cyan");
- axes_y.Parent=LocalBin;
- axes_z=Instance.new("Part");
- axes_z.Anchored=true;
- axes_z.CanCollide=false;
- axes_z.Transparency=1;
- Instance.new("CylinderMesh").Parent=axes_z;
- axes_z.Name="axes_x";
- axes_z.formFactor=0;
- axes_z.Size=Vector3.new(1, 3, 1);
- axes_z.BrickColor=BrickColor.new("Magenta");
- axes_z.Parent=LocalBin;
- aabb=Instance.new("Part");
- aabb.Anchored=true;
- aabb.CanCollide=false;
- aabb.Transparency=1;
- aabb.Parent=LocalBin;
- handles=Instance.new("ArcHandles");
- handles.Color=Options.RotateHandlesColor;
- handles.Adornee=aabb;
- handles.Parent=obj1;
- function HandlesUp()
- if #rotate_drag>0 then
- new_cframe={};
- for i,v in pairs(rotate_drag) do
- new_cframe[#new_cframe+1]=v.CFrame;
- end
- History.Action("Rotate", rotate_drag, original_cframe, new_cframe);
- rotate_drag={};
- end
- end;
- old_rotation=0;
- rotate_drag={};
- original_cframe={};
- rotate_by=Vector3.new(0,0,0);
- handles.MouseButton1Down:connect(function(axis)
- if axis==Enum.Axis.X then
- rotate_by=Vector3.new(1,0,0);
- elseif axis==Enum.Axis.Y then
- rotate_by=Vector3.new(0,1,0);
- elseif axis==Enum.Axis.Z then
- rotate_by=Vector3.new(0,0,1);
- end
- rotate_drag=HasPermission(GetParts(Selection.Get()), "handles_rotate");
- old_rotation=0;
- original_cframe={};
- for i,v in pairs(rotate_drag) do
- original_cframe[i]=v.CFrame;
- end
- end)
- handles.MouseButton1Up:connect(HandlesUp)
- handles.MouseDrag:connect(function(face, dist)
- if #rotate_drag>0 then
- new_dist = round(dist - old_rotation, math.rad(Options.RotateDragIntervals));
- if new_dist~=0 then
- if FunctionData.Rotate.Around~=nil and FunctionData.Rotate.WorldAxis then
- center=CFrame.new(FunctionData.Rotate.Around.Position);
- origin={};
- for i,v in pairs(rotate_drag) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- elseif FunctionData.Rotate.Around~=nil and not FunctionData.Rotate.WorldAxis then
- center=FunctionData.Rotate.Around.CFrame;
- origin={};
- for i,v in pairs(rotate_drag) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- else
- center = Vector3.new();
- for i,v in pairs(rotate_drag) do
- center = center + v.Position;
- end
- center = CFrame.new(center / #rotate_drag);
- origin={};
- for i,v in pairs(rotate_drag) do
- origin[v]=center:toObjectSpace(v.CFrame)
- end
- center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
- for i,v in pairs(origin) do
- i.CFrame=center:toWorldSpace(v)
- end
- end
- end
- old_rotation = old_rotation + new_dist;
- end
- end)
- function UpdateHandles()
- parts=HasPermission(GetParts(Selection.Get()), "handles_rotate");
- if #parts>0 then
- if FunctionData.Rotate.Around~=nil and FunctionData.Rotate.WorldAxis then
- center=FunctionData.Rotate.Around.CFrame.p;
- max=0;
- for i,v in pairs(parts) do
- for x=-1,1,2 do
- for y=-1,1,2 do
- for z=-1,1,2 do
- local s=v.Size/2;
- local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
- max=math.max(max, (p - center).magnitude);
- end
- end
- end
- end
- aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
- aabb.CFrame = CFrame.new(center);
- if aabb.Parent then handles.Visible=true; end
- elseif FunctionData.Rotate.Around~=nil and not FunctionData.Rotate.WorldAxis then
- center=FunctionData.Rotate.Around.CFrame.p;
- max=0;
- for i,v in pairs(parts) do
- for x=-1,1,2 do
- for y=-1,1,2 do
- for z=-1,1,2 do
- local s=v.Size/2;
- local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
- max=math.max(max, (p - center).magnitude);
- end
- end
- end
- end
- aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
- aabb.CFrame = FunctionData.Rotate.Around.CFrame;
- if aabb.Parent then handles.Visible=true; end
- else
- center = Vector3.new();
- for i,v in pairs(parts) do
- center = center + v.Position;
- end
- center = center / #parts;
- max=0;
- for i,v in pairs(parts) do
- for x=-1,1,2 do
- for y=-1,1,2 do
- for z=-1,1,2 do
- local s=v.Size/2;
- local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
- max=math.max(max, (p - center).magnitude);
- end
- end
- end
- end
- aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
- aabb.CFrame = CFrame.new(center);
- if aabb.Parent then handles.Visible=true; end
- end
- else
- handles.Visible=false;
- end
- end
- round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
- UpdateHandles();
- end
- --[[ Selection
- void Selection.Add(p as Part)
- void Selection.Remove(p as Part)
- bool Selection.Check(p as Part)
- void Selection.Clear()
- table Selection.Get() --returns all selected parts
- ]]
- function getAABB(parts)
- if type(parts)~="table" then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
- if #parts==0 then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
- local min=parts[1].Position
- local max=parts[1].Position
- for i,v in pairs(parts) do
- for x=-1,1,2 do
- for y=-1,1,2 do
- for z=-1,1,2 do
- local s=v.Size/2;
- local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
- min=Vector3.new(math.min(p.x,min.x),math.min(p.y,min.y),math.min(p.z,min.z));
- max=Vector3.new(math.max(p.x,max.x),math.max(p.y,max.y),math.max(p.z,max.z));
- end
- end
- end
- end
- return min,max
- end
- function DistanceAlongLine(lineStart, lineDirection, point)
- return ((point - lineStart):Dot(lineDirection)) / (lineDirection:Dot(lineDirection)) --(lineStart + distanceAlongLine * lineDirection)
- end
- Selx={part, box, bb};
- Selx.Remove=function(self)
- if self.box~=nil then
- self.box.Parent=nil;
- end
- if self.bb~=nil then
- self.bb.Parent=nil;
- end
- end;
- Selx.new=function()
- local o={};
- setmetatable(o, {__index = Selx});
- return o;
- end;
- Selection={Parts={},};
- Selection.Add=function(p)
- for i,v in pairs(Selection.Parts) do
- if v.part==p or v.part:IsAncestorOf(p) then
- return nil;
- end
- end
- for i=#Selection.Parts, 1, -1 do
- if Selection.Parts[i].part:IsDescendantOf(p) then
- Selection.Parts[i]:Remove();
- table.remove(Selection.Parts, i);
- end
- end
- e=Selx.new();
- e.part = p;
- e.box = Instance.new("SelectionBox");
- e.box.Adornee = p;
- e.box.Color = Options.BoundingBoxColor;
- e.box.Parent = gui;
- Selection.Parts[#Selection.Parts+1] = e;
- end;
- Selection.Remove=function(p)
- done = false;
- while not done do
- done = true;
- for i = #Selection.Parts, 1, -1 do
- if Selection.Parts[i].part==p then
- Selection.Parts[i]:Remove();
- table.remove(Selection.Parts, i);
- done=true;
- i = 0;
- elseif Selection.Parts[i].part:IsAncestorOf(p) then
- for a,v in pairs(Selection.Parts[i].part:GetChildren()) do
- e=Selx.new();
- e.part = v;
- e.box = Instance.new("SelectionBox");
- e.box.Adornee = v;
- e.box.Color = Options.BoundingBoxColor;
- e.box.Parent = gui;
- Selection.Parts[#Selection.Parts+1] = e;
- end
- done=false;
- Selection.Parts[i]:Remove();
- table.remove(Selection.Parts, i);
- elseif Selection.Parts[i].part:IsDescendantOf(p) then
- Selection.Parts[i]:Remove();
- table.remove(Selection.Parts, i);
- end
- end
- end
- end;
- Selection.Check=function(p)
- for i,v in pairs(Selection.Parts) do
- if v.part==p or v.part:IsAncestorOf(p) then
- return true;
- end
- end
- end;
- Selection.Get=function()
- parts={};
- for i,v in pairs(Selection.Parts) do
- parts[#parts+1]=v.part;
- end
- return parts;
- end;
- Selection.Clear=function()
- for i,v in pairs(Selection.Parts) do
- v:Remove();
- end
- Selection.Parts={};
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Shape()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- prior={};
- after={};
- parts=HasPermission(GetParts(Selection.Get()), "shape");
- made_change=false;
- for i,v in pairs(parts) do
- if v.className=="Part" then
- prior[i]={v, v.CFrame, v.Size, v.Shape};
- else
- prior[i]={v, v.CFrame, v.Size};
- end
- if FunctionData.Shape.Mode=="Brick" and v.className~="Part" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("Part");
- new.Shape=Enum.PartType.Block;
- if v:IsA("BasePart") and not v:IsA("TrussPart") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Brick" and v.className=="Part" and v.Shape~=Enum.PartType.Block then
- local cf=v.CFrame;
- v.Shape=Enum.PartType.Block;
- v.CFrame=cf;
- after[i]={nil, Enum.PartType.Block};
- made_change=true;
- elseif FunctionData.Shape.Mode=="Wedge" and v.className~="WedgePart" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("WedgePart");
- if v:IsA("BasePart") and not v:IsA("TrussPart") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Sphere" and v.className~="Part" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("Part");
- new.Shape=Enum.PartType.Ball;
- if v:IsA("BasePart") and not v:IsA("TrussPart") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Sphere" and v.className=="Part" and v.Shape~=Enum.PartType.Ball then
- local cf=v.CFrame;
- v.Shape=Enum.PartType.Ball;
- v.CFrame=cf;
- after[i]={nil, Enum.PartType.Ball};
- made_change=true;
- elseif FunctionData.Shape.Mode=="Cylinder" and v.className~="Part" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("Part");
- new.Shape=Enum.PartType.Cylinder;
- if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Cylinder" and v.className=="Part" and v.Shape~=Enum.PartType.Cylinder then
- local cf=v.CFrame;
- v.Shape=Enum.PartType.Cylinder;
- v.CFrame=cf;
- after[i]={nil, Enum.PartType.Cylinder};
- made_change=true;
- elseif FunctionData.Shape.Mode=="Truss" and v.className~="TrussPart" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("TrussPart");
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="SpawnLocation" and v.className~="SpawnLocation" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("SpawnLocation");
- if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Seat" and v.className~="Seat" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("Seat");
- if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="VehicleSeat" and v.className~="VehicleSeat" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("VehicleSeat");
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- elseif FunctionData.Shape.Mode=="Skateboard" and v.className~="SkateboardPlatform" then
- local par=v.Parent;
- v.Parent=nil;
- Selection.Remove(v);
- local new=Instance.new("SkateboardPlatform");
- if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
- new.FormFactor=v.FormFactor;
- else
- new.FormFactor=Enum.FormFactor.Custom;
- end
- new.Size=v.Size;
- new.CFrame=v.CFrame;
- new.BrickColor=v.BrickColor;
- new.Material=v.Material;
- new.Reflectance=v.Reflectance;
- new.Transparency=v.Transparency;
- new.Name=v.Name;
- new.RotVelocity=v.RotVelocity;
- new.Velocity=v.Velocity;
- new.Anchored=v.Anchored;
- new.CanCollide=v.CanCollide;
- new.Locked=v.Locked;
- new.Elasticity=v.Elasticity;
- new.Friction=v.Friction;
- new.BackSurface=v.BackSurface
- new.BottomSurface=v.BottomSurface
- new.FrontSurface=v.FrontSurface
- new.LeftSurface=v.LeftSurface
- new.RightSurface=v.RightSurface
- new.TopSurface=v.TopSurface
- for _,a in pairs(v:GetChildren()) do
- a:clone().Parent=new;
- end
- new.Parent=par;
- after[i]={new};
- Selection.Add(new);
- made_change=true;
- end
- end
- if made_change then History.Action("Shape", parts, prior, after); end
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Shape = FunctionData.Shape or {};
- FunctionData.Shape.Mode = FunctionData.Shape.Mode or "Brick";
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(215/255,247/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Shape" obj40.Position=UDim2.new(0,243,1,-182) obj40.Size=UDim2.new(0,84,0,182)
- obj41=Instance.new("TextButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="Brick" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="Brick" obj41.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="Wedge" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,22) obj42.Size=UDim2.new(0,80,0,18) obj42.Text="Wedge" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="Sphere" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,42) obj43.Size=UDim2.new(0,80,0,18) obj43.Text="Sphere" obj43.TextColor3=Color3.new(27/255,42/255,53/255)
- obj44=Instance.new("TextButton") obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Name="Truss" obj44.Parent=obj40 obj44.Position=UDim2.new(0,2,0,62) obj44.Size=UDim2.new(0,80,0,18) obj44.Text="Truss" obj44.TextColor3=Color3.new(27/255,42/255,53/255)
- obj45=Instance.new("TextButton") obj45.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Name="Cylinder" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,82) obj45.Size=UDim2.new(0,80,0,18) obj45.Text="Cylinder" obj45.TextColor3=Color3.new(27/255,42/255,53/255)
- obj46=Instance.new("TextButton") obj46.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Name="SpawnLocation" obj46.Parent=obj40 obj46.Position=UDim2.new(0,2,0,102) obj46.Size=UDim2.new(0,80,0,18) obj46.Text="SpawnLocation" obj46.TextColor3=Color3.new(27/255,42/255,53/255)
- obj47=Instance.new("TextButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Name="Seat" obj47.Parent=obj40 obj47.Position=UDim2.new(0,2,0,122) obj47.Size=UDim2.new(0,80,0,18) obj47.Text="Seat" obj47.TextColor3=Color3.new(27/255,42/255,53/255)
- obj48=Instance.new("TextButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Name="VehicleSeat" obj48.Parent=obj40 obj48.Position=UDim2.new(0,2,0,142) obj48.Size=UDim2.new(0,80,0,18) obj48.Text="VehicleSeat" obj48.TextColor3=Color3.new(27/255,42/255,53/255)
- obj49=Instance.new("TextButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Name="SkateboardPlatform" obj49.Parent=obj40 obj49.Position=UDim2.new(0,2,0,162) obj49.Size=UDim2.new(0,80,0,18) obj49.Text="Skateboard" obj49.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- function RefreshButtons()
- obj41.BackgroundColor3 = FunctionData.Shape.Mode=="Brick" and Options.SelectedColor or Options.ButtonColor;
- obj42.BackgroundColor3 = FunctionData.Shape.Mode=="Wedge" and Options.SelectedColor or Options.ButtonColor;
- obj43.BackgroundColor3 = FunctionData.Shape.Mode=="Sphere" and Options.SelectedColor or Options.ButtonColor;
- obj44.BackgroundColor3 = FunctionData.Shape.Mode=="Truss" and Options.SelectedColor or Options.ButtonColor;
- obj45.BackgroundColor3 = FunctionData.Shape.Mode=="Cylinder" and Options.SelectedColor or Options.ButtonColor;
- obj46.BackgroundColor3 = FunctionData.Shape.Mode=="SpawnLocation" and Options.SelectedColor or Options.ButtonColor;
- obj47.BackgroundColor3 = FunctionData.Shape.Mode=="Seat" and Options.SelectedColor or Options.ButtonColor;
- obj48.BackgroundColor3 = FunctionData.Shape.Mode=="VehicleSeat" and Options.SelectedColor or Options.ButtonColor;
- obj49.BackgroundColor3 = FunctionData.Shape.Mode=="Skateboard" and Options.SelectedColor or Options.ButtonColor;
- end
- obj41.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Brick"; RefreshButtons(); end)
- obj42.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Wedge"; RefreshButtons(); end)
- obj43.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Sphere"; RefreshButtons(); end)
- obj44.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Truss"; RefreshButtons(); end)
- obj45.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Cylinder"; RefreshButtons(); end)
- obj46.MouseButton1Down:connect(function() FunctionData.Shape.Mode="SpawnLocation"; RefreshButtons(); end)
- obj47.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Seat"; RefreshButtons(); end)
- obj48.MouseButton1Down:connect(function() FunctionData.Shape.Mode="VehicleSeat"; RefreshButtons(); end)
- obj49.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Skateboard"; RefreshButtons(); end)
- RefreshButtons();
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Surface()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- sb.Parent=nil;
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Button1Down" then
- if p[2].Target~=nil and FunctionData.Surface.Choosing then
- sb.Visible=false;
- FunctionData.Surface.Choosing=false;
- FunctionData.Surface.Face=p[2].TargetSurface;
- RefreshButtons();
- end
- Passive(p);
- elseif c=="Move" then
- if FunctionData.Surface.Choosing and p[2].Target~=nil then
- sb.Adornee=p[2].Target;
- sb.TargetSurface=p[2].TargetSurface;
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- made_a_change=false;
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "surface");
- for i,v in pairs(parts) do
- if FunctionData.Surface.Face==Enum.NormalId.Left then
- prior[i]=v.LeftSurface;
- v.LeftSurface=FunctionData.Surface.Mode;
- if v.LeftSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- elseif FunctionData.Surface.Face==Enum.NormalId.Right then
- prior[i]=v.RightSurface;
- v.RightSurface=FunctionData.Surface.Mode;
- if v.RightSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- elseif FunctionData.Surface.Face==Enum.NormalId.Top then
- prior[i]=v.TopSurface;
- v.TopSurface=FunctionData.Surface.Mode;
- if v.TopSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- elseif FunctionData.Surface.Face==Enum.NormalId.Bottom then
- prior[i]=v.BottomSurface;
- v.BottomSurface=FunctionData.Surface.Mode;
- if v.BottomSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- elseif FunctionData.Surface.Face==Enum.NormalId.Front then
- prior[i]=v.FrontSurface;
- v.FrontSurface=FunctionData.Surface.Mode;
- if v.FrontSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- elseif FunctionData.Surface.Face==Enum.NormalId.Back then
- prior[i]=v.BackSurface;
- v.BackSurface=FunctionData.Surface.Mode;
- if v.BackSurface~=FunctionData.Surface.Mode then
- made_a_change=true;
- end
- end
- end
- History.Action("Surface", parts, FunctionData.Surface.Face, prior, FunctionData.Surface.Mode);
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Surface = FunctionData.Surface or {};
- FunctionData.Surface.Mode = FunctionData.Surface.Mode or Enum.SurfaceType.Smooth;
- FunctionData.Surface.Face = FunctionData.Surface.Face or Enum.NormalId.Left;
- FunctionData.Surface.Choosing = false;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(214/255,246/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Surface" obj40.Position=UDim2.new(0,243,1,-200) obj40.Size=UDim2.new(0,306,0,60)
- obj41=Instance.new("ImageButton") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Image="http://www.roblox.com/Asset/?ID=16171080" obj41.Name="Weld" obj41.Parent=obj40 obj41.Position=UDim2.new(0,192,0,2) obj41.Size=UDim2.new(0,36,0,36)
- obj42=Instance.new("ImageButton") obj42.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Image="http://www.roblox.com/Asset/?ID=16171136" obj42.Name="Universal" obj42.Parent=obj40 obj42.Position=UDim2.new(0,116,0,2) obj42.Size=UDim2.new(0,36,0,36)
- obj43=Instance.new("ImageButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Image="http://www.roblox.com/Asset/?ID=16171065" obj43.Name="Hinge" obj43.Parent=obj40 obj43.Position=UDim2.new(0,230,0,2) obj43.Size=UDim2.new(0,36,0,36)
- obj44=Instance.new("ImageButton") obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj44.BorderColor3=Color3.new(27/255,42/255,53/255) obj44.Image="http://www.roblox.com/Asset/?ID=16171066" obj44.Name="Inlet" obj44.Parent=obj40 obj44.Position=UDim2.new(0,78,0,2) obj44.Size=UDim2.new(0,36,0,36)
- obj45=Instance.new("ImageButton") obj45.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj45.BorderColor3=Color3.new(27/255,42/255,53/255) obj45.Image="http://www.roblox.com/Asset/?ID=16171076" obj45.Name="Smooth" obj45.Parent=obj40 obj45.Position=UDim2.new(0,2,0,2) obj45.Size=UDim2.new(0,36,0,36)
- obj46=Instance.new("ImageButton") obj46.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj46.BorderColor3=Color3.new(27/255,42/255,53/255) obj46.Image="http://www.roblox.com/Asset/?ID=16171077" obj46.Name="Studs" obj46.Parent=obj40 obj46.Position=UDim2.new(0,40,0,2) obj46.Size=UDim2.new(0,36,0,36)
- obj47=Instance.new("ImageButton") obj47.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj47.BorderColor3=Color3.new(27/255,42/255,53/255) obj47.Image="http://www.roblox.com/Asset/?ID=16171070" obj47.Name="Motor" obj47.Parent=obj40 obj47.Position=UDim2.new(0,268,0,2) obj47.Size=UDim2.new(0,36,0,36)
- obj48=Instance.new("ImageButton") obj48.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj48.BorderColor3=Color3.new(27/255,42/255,53/255) obj48.Image="http://www.roblox.com/Asset/?ID=16171062" obj48.Name="Glue" obj48.Parent=obj40 obj48.Position=UDim2.new(0,154,0,2) obj48.Size=UDim2.new(0,36,0,36)
- obj49=Instance.new("TextButton") obj49.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj49.BorderColor3=Color3.new(27/255,42/255,53/255) obj49.Name="Left" obj49.Parent=obj40 obj49.Position=UDim2.new(0,2,0,40) obj49.Size=UDim2.new(0,41,0,18) obj49.Text="Left" obj49.TextColor3=Color3.new(27/255,42/255,53/255)
- obj50=Instance.new("TextButton") obj50.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj50.BorderColor3=Color3.new(27/255,42/255,53/255) obj50.Name="Right" obj50.Parent=obj40 obj50.Position=UDim2.new(0,45,0,40) obj50.Size=UDim2.new(0,42,0,18) obj50.Text="Right" obj50.TextColor3=Color3.new(27/255,42/255,53/255)
- obj51=Instance.new("TextButton") obj51.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj51.BorderColor3=Color3.new(27/255,42/255,53/255) obj51.Name="Top" obj51.Parent=obj40 obj51.Position=UDim2.new(0,89,0,40) obj51.Size=UDim2.new(0,41,0,18) obj51.Text="Top" obj51.TextColor3=Color3.new(27/255,42/255,53/255)
- obj52=Instance.new("TextButton") obj52.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj52.BorderColor3=Color3.new(27/255,42/255,53/255) obj52.Name="Bottom" obj52.Parent=obj40 obj52.Position=UDim2.new(0,132,0,40) obj52.Size=UDim2.new(0,42,0,18) obj52.Text="Bottom" obj52.TextColor3=Color3.new(27/255,42/255,53/255)
- obj53=Instance.new("TextButton") obj53.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj53.BorderColor3=Color3.new(27/255,42/255,53/255) obj53.Name="Front" obj53.Parent=obj40 obj53.Position=UDim2.new(0,176,0,40) obj53.Size=UDim2.new(0,41,0,18) obj53.Text="Front" obj53.TextColor3=Color3.new(27/255,42/255,53/255)
- obj54=Instance.new("TextButton") obj54.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj54.BorderColor3=Color3.new(27/255,42/255,53/255) obj54.Name="Back" obj54.Parent=obj40 obj54.Position=UDim2.new(0,219,0,40) obj54.Size=UDim2.new(0,42,0,18) obj54.Text="Back" obj54.TextColor3=Color3.new(27/255,42/255,53/255)
- obj55=Instance.new("TextButton") obj55.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj55.BorderColor3=Color3.new(27/255,42/255,53/255) obj55.Name="Pick" obj55.Parent=obj40 obj55.Position=UDim2.new(0,263,0,40) obj55.Size=UDim2.new(0,41,0,18) obj55.Text="Pick" obj55.TextColor3=Color3.new(27/255,42/255,53/255)
- obj40.Parent=obj1;
- sb=Instance.new("SurfaceSelection");
- sb.Color=Options.SurfaceSelectionColor;
- sb.Visible=false;
- sb.Parent=obj40;
- function RefreshButtons()
- for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48}) do
- v.BackgroundColor3=Options.ButtonColor;
- end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Weld then obj41.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Universal then obj42.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Hinge then obj43.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Inlet then obj44.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Smooth then obj45.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Studs then obj46.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Motor then obj47.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Mode==Enum.SurfaceType.Glue then obj48.BackgroundColor3=Options.SelectedColor; end
- for i,v in pairs({obj49, obj50, obj51, obj52, obj53, obj54, obj55}) do
- v.BackgroundColor3=Options.ButtonColor;
- end
- if FunctionData.Surface.Choosing then
- obj55.BackgroundColor3=Options.SelectedColor;
- else
- if FunctionData.Surface.Face==Enum.NormalId.Left then obj49.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Face==Enum.NormalId.Right then obj50.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Face==Enum.NormalId.Top then obj51.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Face==Enum.NormalId.Bottom then obj52.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Face==Enum.NormalId.Front then obj53.BackgroundColor3=Options.SelectedColor; end
- if FunctionData.Surface.Face==Enum.NormalId.Back then obj54.BackgroundColor3=Options.SelectedColor; end
- end
- end
- obj41.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Weld; RefreshButtons(); end)
- obj42.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Universal; RefreshButtons(); end)
- obj43.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Hinge; RefreshButtons(); end)
- obj44.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Inlet; RefreshButtons(); end)
- obj45.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Smooth; RefreshButtons(); end)
- obj46.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Studs; RefreshButtons(); end)
- obj47.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Motor; RefreshButtons(); end)
- obj48.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Glue; RefreshButtons(); end)
- obj49.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Left; RefreshButtons(); end)
- obj50.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Right; RefreshButtons(); end)
- obj51.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Top; RefreshButtons(); end)
- obj52.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Bottom; RefreshButtons(); end)
- obj53.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Front; RefreshButtons(); end)
- obj54.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Back; RefreshButtons(); end)
- obj55.MouseButton1Down:connect(function()
- FunctionData.Surface.Choosing=true;
- sb.Adornee=nil;
- sb.Visible=true;
- RefreshButtons();
- end)
- end
- --[[
- void TB.insert(textbox as TextBox, textbutton as TextButton)
- void TB.enter()
- void TB.remove(item as TextBox, item as TextButton)
- void TB.clean()
- ]]
- TB={
- insert=function(textbox,textbutton)
- local cxn1=textbutton.MouseEnter:connect(function()
- textbox.Visible=true;
- TB.current=textbutton;
- end);
- local cxn2=textbutton.MouseLeave:connect(function()
- wait()
- textbox.Visible=false;
- if TB.current==textbutton then
- TB.current=nil;
- end
- end);
- local cxn3=textbutton.MouseButton1Down:connect(function()
- TB.enter();
- end);
- table.insert(TB.items,{textbox,textbutton,cxn1,cxn2,cxn3});
- end,
- enter=function()
- for i,v in pairs(TB.items) do
- if v[2]==TB.current then
- TB.current.Text=v[1].Text;
- end
- end
- end,
- remove=function(item)
- for i,v in pairs(TB.items) do
- if item==v[1] or item==v[2] then
- v[3]:disconnect();
- v[4]:disconnect();
- v[5]:disconnect();
- table.remove(TB.items,i);
- if TB.current==v[2] then
- TB.current=nil;
- end
- end
- end
- end,
- clean=function()
- for i=#TB.items,1,-1 do
- if TB.items[i][1].Parent==nil and TB.items[i][2].Parent==nil then
- TB.items[i][3]:disconnect();
- TB.items[i][4]:disconnect();
- TB.items[i][5]:disconnect();
- table.remove(TB.items,i);
- end
- end
- end,
- current=nil,
- items={},
- };
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Transparency()
- function Active(p)
- local c=p[1];
- if c=="Unload" then
- obj40.Parent=nil;
- TB.remove(obj41);
- FunctionData.Transparency.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- Spawn(function()
- local t = tab_index;
- wait(Options.RepeatDelay);
- while keys.check(9) and t==tab_index do
- HitButton(gui26);
- wait(Options.RepeatRate);
- end
- end);
- end
- Passive(p);
- return;
- elseif c=="KeyUp" then
- if string.byte(p[3])==9 then
- tab_index = tab_index + 1;
- end
- Passive(p);
- elseif c=="Apply" then
- prior={};
- after={};
- parts=HasPermission(GetParts(Selection.Get()), "transparency");
- FunctionData.Transparency.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
- for i,v in pairs(parts) do
- prior[i]=v.Transparency;
- if FunctionData.Transparency.Relative then
- v.Transparency=math.min(1, math.max(0, v.Transparency+FunctionData.Transparency.Value));
- else
- v.Transparency=math.min(1, math.max(0, FunctionData.Transparency.Value));
- end
- after[i]=v.Transparency;
- end
- pass_action=false;
- for i,v in pairs(prior) do
- if prior[i]~=after[i] then
- pass_action=true;
- end
- end
- if pass_action then
- History.Action("Transparency", parts, prior, after);
- end
- return;
- else
- Passive(p);
- end
- end
- tab_index=0;
- FunctionData.Transparency = FunctionData.Transparency or {};
- FunctionData.Transparency.Relative = FunctionData.Transparency.Relative or false;
- FunctionData.Transparency.Value = FunctionData.Transparency.Value or 0.5;
- obj40=Instance.new("Frame") obj40.BackgroundColor3=Color3.new(213/255,245/255,255/255) obj40.BorderColor3=Color3.new(27/255,42/255,53/255) obj40.Name="Transparency" obj40.Position=UDim2.new(0,243,1,-40) obj40.Size=UDim2.new(0,84,0,40)
- obj41=Instance.new("TextBox") obj41.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj41.BorderColor3=Color3.new(27/255,42/255,53/255) obj41.Name="tBox" obj41.Parent=obj40 obj41.Position=UDim2.new(0,2,0,2) obj41.Size=UDim2.new(0,80,0,18) obj41.Text="" obj41.TextColor3=Color3.new(27/255,42/255,53/255) obj41.Visible=false obj41.ZIndex=2
- obj42=Instance.new("TextButton") obj42.BackgroundColor3=Color3.new(226/255,226/255,226/255) obj42.BorderColor3=Color3.new(27/255,42/255,53/255) obj42.Name="tButton" obj42.Parent=obj40 obj42.Position=UDim2.new(0,2,0,2) obj42.Size=UDim2.new(0,80,0,18) obj42.Text=".5" obj42.TextColor3=Color3.new(27/255,42/255,53/255)
- obj43=Instance.new("TextButton") obj43.BackgroundColor3=Color3.new(255/255,255/255,255/255) obj43.BorderColor3=Color3.new(27/255,42/255,53/255) obj43.Name="RelativeConstant" obj43.Parent=obj40 obj43.Position=UDim2.new(0,2,0,22) obj43.Size=UDim2.new(0,80,0,16) obj43.Text="Constant" obj43.TextColor3=Color3.new(27/255,42/255,53/255)
- obj42.Text = tostring(FunctionData.Transparency.Value);
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- function RefreshButtons()
- obj43.Text = FunctionData.Transparency.Relative and "Relative" or "Constant";
- end
- obj43.MouseButton1Down:connect(function()
- FunctionData.Transparency.Relative = not FunctionData.Transparency.Relative;
- RefreshButtons();
- end)
- RefreshButtons();
- end
- --[[ Utilities ]]
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Utilities()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- obj40.Parent=nil;
- return;
- else
- Passive(p);
- end
- end
- modes={};
- for i,v in pairs(script:GetChildren()) do
- if string.sub(v.Name,1,8)=="Utility:" and v:IsA("StringValue") then
- modes[#modes+1]=v;
- end
- end
- for i,v in pairs(script.Parent:GetChildren()) do
- if string.sub(v.Name,1,8)=="Utility:" and v:IsA("StringValue") then
- modes[#modes+1]=v;
- end
- end
- rows=1;
- width=140;
- height=20;
- buffer=2;
- obj40=Instance.new("Frame") obj40.Name="Utilities" obj40.Position=UDim2.new(0,243,1,-200)
- obj40.Size=UDim2.new(0, math.ceil((#modes)/4)*(width+buffer)+buffer, 0, (#modes>=4 and 4 or (#modes)%4)*(height+buffer)+buffer);
- for i,v in pairs(modes) do
- local obj41=Instance.new("TextButton");
- obj41.Size=UDim2.new(0, 140, 0, 20);
- obj41.Position=UDim2.new(0, math.floor((i-1)/rows)*(width+buffer)+buffer, 0, (i-1)%rows*(height+buffer)+buffer);
- obj41.Parent=obj40;
- obj41.Text=string.sub(v.Name, 9);
- obj41.BackgroundColor3=Options.ButtonColor;
- obj41.MouseButton1Down:connect(function()
- input("Unload");
- if v~=nil then
- assert(loadstring(v.Value))();
- end
- end)
- end
- obj40.Parent=obj1;
- end
- PaletteFunctions = PaletteFunctions or {};
- function PaletteFunctions.Velocity()
- function Active(p) --p accepts a table of parameters.
- local c=p[1]; --c is command.
- if c=="Unload" then
- FunctionData.Velocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Velocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Velocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- obj40.Parent=nil;
- TB.remove(obj41);
- TB.remove(obj43);
- TB.remove(obj45);
- return;
- elseif c=="KeyDown" then
- if string.byte(p[3])==9 then
- HitButton(gui26);
- end
- Passive(p);
- return;
- elseif c=="Apply" then
- FunctionData.Velocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
- FunctionData.Velocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
- FunctionData.Velocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
- prior={};
- parts=HasPermission(GetParts(Selection.Get()), "velocity");
- for i,v in pairs(parts) do
- prior[i]=v.Velocity;
- v.Velocity=Vector3.new(FunctionData.Velocity.x, FunctionData.Velocity.y, FunctionData.Velocity.z);
- end
- History.Action("Velocity", parts, prior, Vector3.new(FunctionData.Velocity.x, FunctionData.Velocity.y, FunctionData.Velocity.z));
- return;
- else
- Passive(p);
- end
- end
- FunctionData.Velocity = FunctionData.Velocity or {};
- FunctionData.Velocity.x = FunctionData.Velocity.x or 0;
- FunctionData.Velocity.y = FunctionData.Velocity.y or 0;
- FunctionData.Velocity.z = FunctionData.Velocity.z or 0;
- obj40=Instance.new("Frame"); obj40.BackgroundColor3=Color3.new(213/255,245/255,255/255); obj40.BorderColor3=Color3.new(27/255,42/255,53/255); obj40.Name="Velocity"; obj40.Position=UDim2.new(0,243,1,-62); obj40.Size=UDim2.new(0,84,0,62);
- obj41=Instance.new("TextBox"); obj41.BackgroundColor3=Color3.new(255/255,255/255,0/255); obj41.BorderColor3=Color3.new(27/255,42/255,53/255); obj41.Name="xBox"; obj41.Parent=obj40; obj41.Position=UDim2.new(0,2,0,2); obj41.Size=UDim2.new(0,80,0,18); obj41.Text="X"; obj41.TextColor3=Color3.new(27/255,42/255,53/255); obj41.Visible=false; obj41.ZIndex=2;
- obj42=Instance.new("TextButton"); obj42.BackgroundColor3=Color3.new(255/255,255/255,85/255); obj42.BorderColor3=Color3.new(27/255,42/255,53/255); obj42.Name="xButton"; obj42.Parent=obj40; obj42.Position=UDim2.new(0,2,0,2); obj42.Size=UDim2.new(0,80,0,18); obj42.Text="X"; obj42.TextColor3=Color3.new(27/255,42/255,53/255);
- obj43=Instance.new("TextBox"); obj43.BackgroundColor3=Color3.new(0/255,255/255,255/255); obj43.BorderColor3=Color3.new(27/255,42/255,53/255); obj43.Name="yBox"; obj43.Parent=obj40; obj43.Position=UDim2.new(0,2,0,22); obj43.Size=UDim2.new(0,80,0,18); obj43.Text="Y"; obj43.TextColor3=Color3.new(27/255,42/255,53/255); obj43.Visible=false; obj43.ZIndex=2;
- obj44=Instance.new("TextButton"); obj44.BackgroundColor3=Color3.new(157/255,255/255,255/255); obj44.BorderColor3=Color3.new(27/255,42/255,53/255); obj44.Name="yButton"; obj44.Parent=obj40; obj44.Position=UDim2.new(0,2,0,22); obj44.Size=UDim2.new(0,80,0,18); obj44.Text="Y"; obj44.TextColor3=Color3.new(27/255,42/255,53/255);
- obj45=Instance.new("TextBox"); obj45.BackgroundColor3=Color3.new(255/255,0/255,255/255); obj45.BorderColor3=Color3.new(27/255,42/255,53/255); obj45.Name="zBox"; obj45.Parent=obj40; obj45.Position=UDim2.new(0,2,0,42); obj45.Size=UDim2.new(0,80,0,18); obj45.Text="Z"; obj45.TextColor3=Color3.new(27/255,42/255,53/255); obj45.Visible=false; obj45.ZIndex=2;
- obj46=Instance.new("TextButton"); obj46.BackgroundColor3=Color3.new(255/255,149/255,255/255); obj46.BorderColor3=Color3.new(27/255,42/255,53/255); obj46.Name="zButton"; obj46.Parent=obj40; obj46.Position=UDim2.new(0,2,0,42); obj46.Size=UDim2.new(0,80,0,18); obj46.Text="Z"; obj46.TextColor3=Color3.new(27/255,42/255,53/255);
- obj42.Text=FunctionData.Velocity.x;
- obj44.Text=FunctionData.Velocity.y;
- obj46.Text=FunctionData.Velocity.z;
- obj40.Parent=obj1;
- TB.insert(obj41, obj42);
- TB.insert(obj43, obj44);
- TB.insert(obj45, obj46);
- end
- Drag={};
- Drag.Dragging=false;
- Drag.Main=nil;
- Drag.Offset=Vector3.new();
- Drag.Parts={};
- Drag.Dragger=Instance.new("Dragger");
- Drag.Down=function(main, offset, parts)
- if not Drag.Dragging then
- Drag.OriginalPositions={};
- for i,v in pairs(parts) do
- Drag.OriginalPositions[#Drag.OriginalPositions+1]=v.CFrame;
- end
- Drag.Dragger:MouseDown(main, offset, parts);
- Drag.Dragging=true;
- Drag.Main=main;
- Drag.Offset=offset;
- Drag.Parts=parts;
- end
- end;
- Drag.Up=function()
- if Drag.Dragging then
- local change=false;
- local FinalPositions={};
- for i,v in pairs(Drag.Parts) do
- FinalPositions[#FinalPositions+1]=v.CFrame;
- if Drag.OriginalPositions[i]~=v.CFrame then
- change=true;
- end
- end
- if change then
- History.Action("Move", Drag.Parts, Drag.OriginalPositions, FinalPositions);
- end
- Drag.Dragger:MouseUp();
- Drag.Dragging=false;
- Drag.Main=nil;
- Drag.Offset=Vector3.new();
- Drag.Parts={};
- end
- end
- Drag.Move=function(unitray)
- if Drag.Dragging then
- Drag.Dragger:MouseMove(unitray);
- end
- end
- Drag.Rotate=function(axis)
- if Drag.Dragging then
- Drag.Dragger:AxisRotate(axis)
- end
- end
- CloneOver="http://www.roblox.com/asset/?id=37596643";
- Draggable="http://www.roblox.com/asset/?id=37596643";
- Dragging="http://www.roblox.com/asset/?id=37596650";
- Default="http://www.roblox.com/asset/?id=37596618";
- Selectable="http://www.roblox.com/asset/?id=37596643";
- function GetIcon(part)
- if Drag.Dragging then
- return Dragging;
- end
- if part~=nil then
- if Selection.Check(part) and Permission(part, "drag") then
- return Draggable;
- elseif not Selection.Check(part) and Permission(part, "select") then
- return Selectable;
- elseif Permission(part, "clone") then
- return CloneOver;
- end
- end
- return Default;
- end;
- --[[ GetParts ]]
- function Recurse(t)
- local p={}
- for i,v in pairs(t) do
- if v:IsA("BasePart") then table.insert(p,v); end
- if #v:GetChildren()>0 then
- local parts=Recurse(v:GetChildren(),p);
- for a,b in pairs(parts) do
- table.insert(p,b);
- end
- end
- end
- return p;
- end
- function GetParts(t)
- p=Recurse(t)
- return p;
- end
- --</import>
- script.ChildAdded:connect(function(child)
- if child:IsA("StringValue") and not string.find(child.Name, ":") then
- assert(loadstring(child.Value))();
- end
- end)
- script.Parent.ChildAdded:connect(function(child)
- if child:IsA("StringValue") and not string.find(child.Name, ":") then
- assert(loadstring(child.Value))();
- end
- end)
- function onButton1Down(mouse)
- input("Button1Down", mouse);
- end
- function onButton1Up(mouse)
- input("Button1Up", mouse);
- end
- function onKeyDown(key,mouse)
- input("KeyDown", mouse, key);
- end
- function onKeyUp(key,mouse)
- input("KeyUp", mouse, key);
- end
- function onMove(mouse)
- input("Move", mouse);
- end
- function onSelected(mouse)
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- mouse.Button1Up:connect(function() onButton1Up(mouse) end)
- mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
- mouse.KeyUp:connect(function(key) onKeyUp(key,mouse) end)
- mouse.Move:connect(function() onMove(mouse) end)
- LocalBin.Parent=workspace.CurrentCamera;
- mouse.TargetFilter=LocalBin;
- if player and player:findFirstChild("PlayerGui") then
- gui.Parent=player.PlayerGui;
- else
- player=game.Players.LocalPlayer;
- end
- end
- function onDeselected(mouse)
- gui.Parent=nil;
- LocalBin.Parent=nil;
- end
- Build.Selected:connect(onSelected)
- Build.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement