Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 192.11 KB | None | 0 0
  1. OnlineMode=false; --online mode has a system of permissions. Offline mode does not.
  2. 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.
  3.  
  4. player=game.Players.LocalPlayer;
  5. local Build = Instance.new("HopperBin")
  6. Build.BinType = "Script"
  7. Build.Name = "Build Tool"
  8. Build.Parent = player.Backpack
  9. Options={
  10. RepeatDelay=1, --for holding tab
  11. RepeatRate=.03, --for holding tab
  12. DoubleClickSpeed=.3, --how fast must you double click to select a model
  13.  
  14. BoundingBoxColor=BrickColor.new("Cyan"),
  15. ActiveSelectionBoxColor=BrickColor.new("Really red"),
  16. SurfaceSelectionColor=BrickColor.new("Bright violet"),
  17. DragHandlesColor=BrickColor.new("Bright orange"),
  18. RotateHandlesColor=BrickColor.new("Bright red"),
  19. ResizeHandlesColor=BrickColor.new("Bright blue"),
  20.  
  21. --Sooner or later, I may make all functions pay mind to these values.
  22. SelectedColor=Color3.new(51/255, 153/255, 255/255), --a blue to denote the button is selected
  23. ButtonColor=Color3.new(245/255, 245/255, 245/255), --a white to denote the button can be pressed
  24. InactiveColor=Color3.new(120/255, 120/255, 120/255), --a grey to denote the button can't be clicked
  25. ToolTipColor=Color3.new(254/255, 214/255, 145/255); --a tan (microsoft default)
  26. MainColor=Color3.new(211/255,243/255,255/255); --a light blue for the background of all frames
  27.  
  28. MoveDragIntervals=1,
  29. RotateDragIntervals=5,
  30. ResizeDragIntervals=1,
  31. SmallestSize=Vector3.new(1, 1, 1);
  32.  
  33. DockVisible=true,
  34. CloneShift=true, --when you clone, should the new part appear above the previous, or in the same location?
  35. ThreeAxes=false, --show the 3 axes objects
  36. ToolTipText = "on"; --on, off, immediate
  37. }
  38.  
  39. while workspace.CurrentCamera:findFirstChild("LocalBin")~=nil do workspace.CurrentCamera.LocalBin:remove(); end
  40. LocalBin=Instance.new("Model");
  41. LocalBin.Name="LocalBin";
  42.  
  43. 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)
  44. 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)
  45. 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)
  46. 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)
  47. 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)
  48. 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)
  49. 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)
  50. 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)
  51. 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)
  52. 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)
  53. 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)
  54.  
  55. 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)
  56. 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)
  57. 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)
  58. 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)
  59. 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)
  60. 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)
  61. 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)
  62. 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)
  63. 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)
  64. 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)
  65. 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)
  66. 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)
  67. 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)
  68. 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)
  69. 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)
  70. 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)
  71. 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)
  72. 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)
  73. 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)
  74. 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)
  75. 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)
  76. 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)
  77. 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)
  78. 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)
  79. 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)
  80. 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)
  81. 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)
  82. 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)
  83. 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)
  84. 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)
  85. 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)
  86.  
  87. gui=Instance.new("ScreenGui"); gui.Name="Build";
  88. gui1.Parent=obj1
  89. obj1.Parent=gui
  90.  
  91. Active=function(p) if Passive~=nil then Passive(p); end end
  92. --If you're gonna be making an event get passed through "input",
  93. --make sure the first value passed is a string identifier of the event.
  94. --Any other arguments after that are fair game.
  95. function input(...)
  96. Active({...});
  97. end
  98.  
  99. --<import>
  100. PaletteFunctions = PaletteFunctions or {};
  101.  
  102. function PaletteFunctions.Anchor()
  103.  
  104. function Active(p) --p accepts a table of parameters.
  105. local c=p[1]; --c is command.
  106. if c=="Unload" then
  107. obj40.Parent=nil;
  108. return;
  109. elseif c=="KeyDown" then
  110. if string.byte(p[3])==9 then
  111. HitButton(gui26);
  112. end
  113. Passive(p);
  114. return;
  115. elseif c=="Apply" then
  116. prior={};
  117. parts=HasPermission(GetParts(Selection.Get()), "anchor");
  118. for i,v in pairs(parts) do
  119. prior[i]={v.Anchored, v.Parent, v.CFrame};
  120. v.Anchored=FunctionData.Anchor.Mode;
  121. end
  122. History.Action("Anchor", parts, prior, FunctionData.Anchor.Mode);
  123. return;
  124. else
  125. Passive(p);
  126. end
  127. end
  128.  
  129. FunctionData.Anchor = FunctionData.Anchor or {};
  130. FunctionData.Anchor.Mode = FunctionData.Anchor.Mode or true;
  131.  
  132. 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)
  133. 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)
  134. 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)
  135. obj40.Parent=obj1;
  136.  
  137. obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  138. obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  139.  
  140. obj41.MouseButton1Down:connect(function()
  141. FunctionData.Anchor.Mode = true;
  142. obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  143. obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  144. end)
  145. obj42.MouseButton1Down:connect(function()
  146. FunctionData.Anchor.Mode = false;
  147. obj41.BackgroundColor3 = FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  148. obj42.BackgroundColor3 = not FunctionData.Anchor.Mode and Options.SelectedColor or Options.ButtonColor;
  149. end)
  150.  
  151.  
  152. end
  153.  
  154.  
  155. PaletteFunctions = PaletteFunctions or {};
  156.  
  157. function PaletteFunctions.CanCollide()
  158.  
  159. function Active(p) --p accepts a table of parameters.
  160. local c=p[1]; --c is command.
  161. if c=="Unload" then
  162. obj40.Parent=nil;
  163. return;
  164. elseif c=="KeyDown" then
  165. if string.byte(p[3])==9 then
  166. HitButton(gui26);
  167. end
  168. Passive(p);
  169. return;
  170. elseif c=="Apply" then
  171. prior={};
  172. parts=HasPermission(GetParts(Selection.Get()), "cancollide");
  173. for i,v in pairs(parts) do
  174. prior[i]={v.CanCollide, v.Parent, v.CFrame};
  175. v.CanCollide=FunctionData.CanCollide.Mode;
  176. end
  177. History.Action("CanCollide", parts, prior, FunctionData.CanCollide.Mode);
  178. return;
  179. else
  180. Passive(p);
  181. end
  182. end
  183.  
  184. FunctionData.CanCollide = FunctionData.CanCollide or {};
  185. FunctionData.CanCollide.Mode = FunctionData.CanCollide.Mode or true;
  186.  
  187. 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)
  188. 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)
  189. 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)
  190. obj40.Parent=obj1;
  191.  
  192. obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  193. obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  194.  
  195. obj41.MouseButton1Down:connect(function()
  196. FunctionData.CanCollide.Mode = false;
  197. obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  198. obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  199. end)
  200. obj42.MouseButton1Down:connect(function()
  201. FunctionData.CanCollide.Mode = true;
  202. obj41.BackgroundColor3 = not FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  203. obj42.BackgroundColor3 = FunctionData.CanCollide.Mode and Options.SelectedColor or Options.ButtonColor;
  204. end)
  205.  
  206.  
  207. end
  208.  
  209. PaletteFunctions = PaletteFunctions or {};
  210.  
  211. function PaletteFunctions.Color()
  212.  
  213. mouse_colorCopy = nil;
  214.  
  215. function Active(p) --p accepts a table of parameters.
  216. local c=p[1]; --c is command.
  217. if c=="Unload" then
  218. if obj40~=nil then obj40.Parent=nil; end
  219. if sb~=nil then sb.Parent=nil; end
  220. return;
  221. elseif c=="Button1Down" then
  222. if sb.Visible then
  223. sb.Visible=false;
  224. for i,v in pairs(FunctionData.Color.ColorList) do
  225. if v==p[2].Target.BrickColor.Name then
  226. FunctionData.Color.Choice = i;
  227. RefreshColors();
  228. end
  229. end
  230. else
  231. Passive(p);
  232. end
  233. return;
  234. elseif c=="KeyDown" then
  235. if string.byte(p[3])==9 then
  236. HitButton(gui26);
  237. end
  238. Passive(p);
  239. return;
  240. elseif c=="Move" then
  241. mouse_colorCopy = mouse_colorCopy or p[2];
  242. if sb.Visible then
  243. sb.Adornee=p[2].Target;
  244. end
  245. local obj45=obj45;
  246. Spawn(function()
  247. mouse_over=mouse_over+1;
  248. obj45.BackgroundTransparency=1;
  249. obj45.TextTransparency=1;
  250. if p[2].Target~=nil then
  251. local mo=mouse_over;
  252. if mo==mouse_over and Options.ToolTipText=="on" then
  253. wait(.75)
  254. end
  255. if mo==mouse_over then
  256. obj45.Text=p[2].Target.BrickColor.Name;
  257. obj45.Position=UDim2.new(0,p[2].X-obj40.AbsolutePosition.x,0,p[2].Y-obj40.AbsolutePosition.y-obj45.AbsoluteSize.y);
  258. if Options.ToolTipText=="immediate" then
  259. obj45.BackgroundTransparency=0;
  260. obj45.TextTransparency=0;
  261. end
  262. end
  263. if Options.ToolTipText=="on" then
  264. for transparency=1,0,-.05 do
  265. if mo==mouse_over then
  266. obj45.BackgroundTransparency=transparency;
  267. obj45.TextTransparency=transparency;
  268. wait();
  269. end
  270. end
  271. if mo==mouse_over then
  272. obj45.BackgroundTransparency=0;
  273. obj45.TextTransparency=0;
  274. end
  275. end
  276. end
  277. end)
  278. Passive(p);
  279. return;
  280. elseif c=="Apply" then
  281. prior={};
  282. new={};
  283. parts=HasPermission(GetParts(Selection.Get()), "color");
  284. for i,v in pairs(parts) do
  285. prior[i]=v.BrickColor;
  286. if FunctionData.Color.Choice<=143 then
  287. v.BrickColor=BrickColor.new(FunctionData.Color.ColorList[FunctionData.Color.Choice or 10])
  288. elseif FunctionData.Color.Choice==144 then
  289. --painting a brick while the eyedropper is selected? Using the current mouseOver would be nice...
  290. if mouse_colorCopy~=nil then
  291. if mouse_colorCopy.Target then
  292. v.BrickColor=mouse_colorCopy.Target.BrickColor;
  293. end
  294. end
  295. elseif FunctionData.Color.Choice==145 then
  296. v.BrickColor=BrickColor.new(FunctionData.Color.ColorList[math.random(143)]);
  297. end
  298. new[i]=v.BrickColor;
  299. end
  300. History.Action("Color", parts, prior, new);
  301. return;
  302. else
  303. Passive(p);
  304. end
  305. end
  306.  
  307. function RefreshColors()
  308. for i=1,145 do
  309. if i~=FunctionData.Color.Choice then
  310. obj41:findFirstChild(i).BorderColor3=Color3.new(0,0,0);
  311. else
  312. obj41:findFirstChild(FunctionData.Color.Choice).BorderColor3=Options.SelectedColor;
  313. end
  314. end
  315. end
  316.  
  317. FunctionData.Color = FunctionData.Color or {};
  318. 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"}
  319. FunctionData.Color.Choice = FunctionData.Color.Choice or 10;
  320. 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)
  321. 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)
  322. 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)
  323. 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)
  324. 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
  325.  
  326. obj42.MouseButton1Down:connect(function()
  327. FunctionData.Color.Choice=tonumber(obj42.Name);
  328. RefreshColors();
  329. end)
  330. obj43.MouseButton1Down:connect(function()
  331. FunctionData.Color.Choice=tonumber(obj43.Name);
  332. sb.Visible=true;
  333. RefreshColors();
  334. end)
  335.  
  336. sb=Instance.new("SelectionBox");
  337. sb.Name="ColorEyedropper";
  338. sb.Color=Options.ActiveSelectionBoxColor;
  339. sb.Visible=false;
  340. sb.Parent=obj1;
  341.  
  342. mouse_over=0;
  343.  
  344. for i=0,142,1 do
  345. local obj44=Instance.new("TextButton")
  346. obj44.BackgroundColor3=Color3.new(255/255,255/255,255/255)
  347. obj44.BorderColor3=Color3.new(8/255,8/255,8/255)
  348. obj44.Name=tostring(i+1)
  349. obj44.Position=UDim2.new(0,5+(i%29)*20,0,5+(math.floor(i/29))*20)
  350. obj44.Size=UDim2.new(0,19,0,19)
  351. obj44.Text=""
  352. obj44.BackgroundColor3=BrickColor.new(FunctionData.Color.ColorList[i+1]).Color
  353. obj44.MouseButton1Down:connect(function()
  354. FunctionData.Color.Choice=tonumber(obj44.Name);
  355. RefreshColors()
  356. end)
  357. obj44.MouseMoved:connect(function(x, y)
  358. mouse_over=mouse_over+1;
  359. obj45.BackgroundTransparency=1;
  360. obj45.TextTransparency=1;
  361. local mo=mouse_over;
  362. if Options.ToolTipText=="on" then
  363. wait(.75)
  364. end
  365. if mo==mouse_over then
  366. obj45.Text=FunctionData.Color.ColorList[tonumber(obj44.Name)];
  367. obj45.Position=UDim2.new(0,x-obj40.AbsolutePosition.x,0,y-obj40.AbsolutePosition.y-obj45.AbsoluteSize.y);
  368. if Options.ToolTipText=="immediate" then
  369. obj45.BackgroundTransparency=0;
  370. obj45.TextTransparency=0;
  371. end
  372. end
  373. if Options.ToolTipText=="on" then
  374. for transparency=1,0,-.05 do
  375. if mo==mouse_over then
  376. obj45.BackgroundTransparency=transparency;
  377. obj45.TextTransparency=transparency;
  378. wait();
  379. end
  380. end
  381. if mo==mouse_over then
  382. obj45.BackgroundTransparency=0;
  383. obj45.TextTransparency=0;
  384. end
  385. end
  386. end)
  387. obj44.Parent=obj41
  388. end
  389. obj40.Parent=obj1;
  390.  
  391. RefreshColors();
  392.  
  393. end
  394.  
  395. PaletteFunctions = PaletteFunctions or {};
  396.  
  397. function PaletteFunctions.Elasticity()
  398.  
  399. function Active(p) --p accepts a table of parameters.
  400. local c=p[1]; --c is command.
  401. if c=="Unload" then
  402. FunctionData.Elasticity.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  403. TB.remove(obj41);
  404. obj40.Parent=nil;
  405. return;
  406. elseif c=="KeyDown" then
  407. if string.byte(p[3])==9 then
  408. HitButton(gui26);
  409. end
  410. Passive(p);
  411. return;
  412. elseif c=="Apply" then
  413. FunctionData.Elasticity.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  414. prior={};
  415. parts=HasPermission(GetParts(Selection.Get()), "elasticity");
  416. for i,v in pairs(parts) do
  417. prior[i]=v.Elasticity;
  418. v.Elasticity=FunctionData.Elasticity.value;
  419. end
  420. History.Action("Elasticity", parts, prior, FunctionData.Elasticity.value);
  421. return;
  422. else
  423. Passive(p);
  424. end
  425. end
  426.  
  427. FunctionData.Elasticity = FunctionData.Elasticity or {};
  428. FunctionData.Elasticity.value = FunctionData.Elasticity.value or .5;
  429. 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)
  430. 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
  431. 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)
  432. obj42.Text=FunctionData.Elasticity.value;
  433. obj40.Parent=obj1;
  434.  
  435. TB.insert(obj41, obj42);
  436.  
  437. end
  438.  
  439. PaletteFunctions = PaletteFunctions or {};
  440.  
  441. function PaletteFunctions.FormFactor()
  442.  
  443. function Active(p) --p accepts a table of parameters.
  444. local c=p[1]; --c is command.
  445. if c=="Unload" then
  446. obj40.Parent=nil;
  447. return;
  448. elseif c=="KeyDown" then
  449. if string.byte(p[3])==9 then
  450. HitButton(gui26);
  451. end
  452. Passive(p);
  453. return;
  454. elseif c=="Apply" then
  455. prior={};
  456. after={};
  457. parts=HasPermission(GetParts(Selection.Get()), "formfactor");
  458. for i,v in pairs(parts) do
  459. prior[i]=v.FormFactor;
  460. local cf=v.CFrame;
  461. v.FormFactor=FunctionData.FormFactor.Mode;
  462. v.CFrame=cf;
  463. after[i]=v.FormFactor;
  464. end
  465. History.Action("FormFactor", parts, prior, after);
  466. return;
  467. else
  468. Passive(p);
  469. end
  470. end
  471.  
  472. FunctionData.FormFactor = FunctionData.FormFactor or {};
  473. FunctionData.FormFactor.Mode = FunctionData.FormFactor.Mode or Enum.FormFactor.Custom;
  474.  
  475. 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)
  476. 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)
  477. 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)
  478. 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)
  479. 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)
  480. obj40.Parent=obj1;
  481.  
  482. function RefreshButtons()
  483. obj41.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Plate and Options.SelectedColor or Options.ButtonColor;
  484. obj42.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Symmetric and Options.SelectedColor or Options.ButtonColor;
  485. obj43.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Brick and Options.SelectedColor or Options.ButtonColor;
  486. obj44.BackgroundColor3 = FunctionData.FormFactor.Mode==Enum.FormFactor.Custom and Options.SelectedColor or Options.ButtonColor;
  487. end
  488.  
  489. obj41.MouseButton1Down:connect(function()
  490. FunctionData.FormFactor.Mode=Enum.FormFactor.Plate;
  491. RefreshButtons();
  492. end)
  493. obj42.MouseButton1Down:connect(function()
  494. FunctionData.FormFactor.Mode=Enum.FormFactor.Symmetric;
  495. RefreshButtons();
  496. end)
  497. obj43.MouseButton1Down:connect(function()
  498. FunctionData.FormFactor.Mode=Enum.FormFactor.Brick;
  499. RefreshButtons();
  500. end)
  501. obj44.MouseButton1Down:connect(function()
  502. FunctionData.FormFactor.Mode=Enum.FormFactor.Custom;
  503. RefreshButtons();
  504. end)
  505.  
  506. RefreshButtons();
  507.  
  508. end
  509.  
  510. PaletteFunctions = PaletteFunctions or {};
  511.  
  512. function PaletteFunctions.Friction()
  513.  
  514. function Active(p) --p accepts a table of parameters.
  515. local c=p[1]; --c is command.
  516. if c=="Unload" then
  517. FunctionData.Friction.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  518. TB.remove(obj41);
  519. obj40.Parent=nil;
  520. return;
  521. elseif c=="KeyDown" then
  522. if string.byte(p[3])==9 then
  523. HitButton(gui26);
  524. end
  525. Passive(p);
  526. return;
  527. elseif c=="Apply" then
  528. FunctionData.Friction.value = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  529. prior={};
  530. parts=HasPermission(GetParts(Selection.Get()), "friction");
  531. for i,v in pairs(parts) do
  532. prior[i]=v.Friction;
  533. v.Friction=FunctionData.Friction.value;
  534. end
  535. History.Action("Friction", parts, prior, FunctionData.Friction.value);
  536. return;
  537. else
  538. Passive(p);
  539. end
  540. end
  541.  
  542. FunctionData.Friction = FunctionData.Friction or {};
  543. FunctionData.Friction.value = FunctionData.Friction.value or .5;
  544. 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)
  545. 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
  546. 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)
  547. obj42.Text=FunctionData.Friction.value;
  548. obj40.Parent=obj1;
  549.  
  550. TB.insert(obj41, obj42);
  551.  
  552. end
  553.  
  554. History={Done={}, Undone={}}
  555.  
  556. History.Action=function(...)
  557. History.Done[#History.Done+1]={...};
  558. History.Undone={};
  559. end;
  560. History.Prep=function(...)
  561. History.Undone[#History.Undone+1]={...};
  562. end;
  563.  
  564. History.Undo=function()
  565. if #History.Done>0 then
  566. local p=History.Done[#History.Done];
  567. if p[1]=="Move" then
  568. for i=1,#p[2] do
  569. p[2][i].CFrame=p[3][i];
  570. end
  571. elseif p[1]=="Clone" then
  572. for i,v in pairs(p[2]) do
  573. v.Parent=nil;
  574. if Selection.Check(v) then
  575. Selection.Remove(v);
  576. end
  577. end
  578. elseif p[1]=="Delete" then
  579. for i,v in pairs(p[2]) do
  580. v.Parent=p[3][i];
  581. Selection.Add(v);
  582. end
  583. elseif p[1]=="Resize" then
  584. for i,v in pairs(p[2]) do
  585. local cf=v.CFrame;
  586. v.Size=p[3][i];
  587. v.CFrame=cf;
  588. end
  589. elseif p[1]=="Move+Resize" then
  590. v=p[2];
  591. v.Size=p[5];
  592. v.CFrame=p[3];
  593. elseif p[1]=="Rotate" then
  594. for i,v in pairs(p[2]) do
  595. v.CFrame = p[3][i];
  596. end
  597. elseif p[1]=="Lock" then
  598. for i,v in pairs(p[2]) do
  599. v.Locked = p[3][i];
  600. end
  601. elseif p[1]=="Color" then
  602. for i,v in pairs(p[2]) do
  603. v.BrickColor = p[3][i];
  604. end
  605. elseif p[1]=="Material" then
  606. for i,v in pairs(p[2]) do
  607. v.Material = p[3][i];
  608. end
  609. elseif p[1]=="Transparency" then
  610. for i,v in pairs(p[2]) do
  611. v.Transparency=p[3][i];
  612. end
  613. elseif p[1]=="Reflectance" then
  614. for i,v in pairs(p[2]) do
  615. v.Reflectance=p[3][i];
  616. end
  617. elseif p[1]=="Anchor" then
  618. for i,v in pairs(p[2]) do
  619. v.Anchored = p[3][i][1];
  620. v.Parent=p[3][i][2];
  621. v.CFrame=p[3][i][3];
  622. end
  623. elseif p[1]=="CanCollide" then
  624. for i,v in pairs(p[2]) do
  625. v.CanCollide = p[3][i][1];
  626. v.Parent=p[3][i][2];
  627. v.CFrame=p[3][i][3];
  628. end
  629. elseif p[1]=="FormFactor" then
  630. for i,v in pairs(p[2]) do
  631. local cf=v.CFrame;
  632. v.FormFactor=p[3][i];
  633. v.CFrame=cf;
  634. end
  635. elseif p[1]=="Shape" then
  636. for i,v in pairs(p[2]) do
  637. if p[4]~=nil and p[4][i]~=nil and p[4][i][1]~=nil then
  638. v.Parent=p[4][i][1].Parent;
  639. p[4][i][1].Parent=nil;
  640. if Selection.Check(p[4][i][1]) then
  641. Selection.Add(v);
  642. Selection.Remove(p[4][i][1]);
  643. end
  644. 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
  645. v.Shape=p[3][i][4];
  646. v.Size=p[3][i][3];
  647. v.CFrame=p[3][i][2];
  648. end
  649. end
  650. elseif p[1]=="Surface" then
  651. for i,v in pairs(p[2]) do
  652. if p[3]==Enum.NormalId.Left then v.LeftSurface=p[4][i];
  653. elseif p[3]==Enum.NormalId.Right then v.RightSurface=p[4][i];
  654. elseif p[3]==Enum.NormalId.Top then v.TopSurface=p[4][i];
  655. elseif p[3]==Enum.NormalId.Bottom then v.BottomSurface=p[4][i];
  656. elseif p[3]==Enum.NormalId.Front then v.FrontSurface=p[4][i];
  657. elseif p[3]==Enum.NormalId.Back then v.BackSurface=p[4][i];
  658. end
  659. end
  660. elseif p[1]=="Velocity" then
  661. for i,v in pairs(p[2]) do
  662. v.Velocity=p[3][i];
  663. end
  664. end
  665. History.Undone[#History.Undone+1]=History.Done[#History.Done];
  666. History.Done[#History.Done]=nil;
  667. end
  668. end
  669.  
  670. History.Redo=function()
  671. --handle History.Undone
  672. if #History.Undone>0 then
  673. local p=History.Undone[#History.Undone];
  674. if p[1]=="Move" then
  675. for i,v in pairs(p[2]) do
  676. p[2][i].CFrame=p[4][i];
  677. end
  678. elseif p[1]=="Clone" then
  679. for i=1,#p[2] do
  680. p[2][i].Parent=workspace;
  681. for i,v in pairs(p[3]) do
  682. if v[1]==p[2][i] or v[1]:IsDescendantOf(p[2][i]) then
  683. v[1].CFrame=v[2];
  684. end
  685. end
  686. end
  687. elseif p[1]=="Delete" then
  688. for i,v in pairs(p[2]) do
  689. Selection.Remove(v);
  690. v.Parent=nil;
  691. end
  692. elseif p[1]=="Resize" then
  693. for i,v in pairs(p[2]) do
  694. local cf=v.CFrame;
  695. v.Size=p[4][i];
  696. v.CFrame=cf;
  697. end
  698. elseif p[1]=="Move+Resize" then
  699. v=p[2];
  700. v.Size=p[6];
  701. v.CFrame=p[4];
  702. elseif p[1]=="Rotate" then
  703. for i,v in pairs(p[2]) do
  704. v.CFrame = p[4][i];
  705. end
  706. elseif p[1]=="Lock" then
  707. for i,v in pairs(p[2]) do
  708. v.Locked = p[4];
  709. end
  710. elseif p[1]=="Color" then
  711. for i,v in pairs(p[2]) do
  712. v.BrickColor = p[4][i];
  713. end
  714. elseif p[1]=="Material" then
  715. for i,v in pairs(p[2]) do
  716. v.Material = p[4];
  717. end
  718. elseif p[1]=="Transparency" then
  719. for i,v in pairs(p[2]) do
  720. v.Transparency=p[4][i];
  721. end
  722. elseif p[1]=="Reflectance" then
  723. for i,v in pairs(p[2]) do
  724. v.Reflectance=p[4][i];
  725. end
  726. elseif p[1]=="Anchor" then
  727. for i,v in pairs(p[2]) do
  728. v.Anchored = p[4];
  729. end
  730. elseif p[1]=="CanCollide" then
  731. for i,v in pairs(p[2]) do
  732. v.CanCollide = p[4];
  733. end
  734. elseif p[1]=="FormFactor" then
  735. for i,v in pairs(p[2]) do
  736. local cf=v.CFrame;
  737. v.FormFactor=p[4][i];
  738. v.CFrame=cf;
  739. end
  740. elseif p[1]=="Shape" then
  741. for i,v in pairs(p[2]) do
  742. if p[4][i][1]~=nil then
  743. p[4][i][1].Parent=v.Parent;
  744. v.Parent=nil;
  745. if Selection.Check(p[4][i][1]) then
  746. Selection.Add(v);
  747. Selection.Remove(p[4][i][1]);
  748. end
  749. else
  750. v.Shape=p[4][i][2];
  751. v.Size=p[3][i][3];
  752. v.CFrame=p[3][i][2];
  753. end
  754. end
  755. elseif p[1]=="Surface" then
  756. for i,v in pairs(p[2]) do
  757. if p[3]==Enum.NormalId.Left then v.LeftSurface=p[5];
  758. elseif p[3]==Enum.NormalId.Right then v.RightSurface=p[5];
  759. elseif p[3]==Enum.NormalId.Top then v.TopSurface=p[5];
  760. elseif p[3]==Enum.NormalId.Bottom then v.BottomSurface=p[5];
  761. elseif p[3]==Enum.NormalId.Front then v.FrontSurface=p[5];
  762. elseif p[3]==Enum.NormalId.Back then v.BackSurface=p[5];
  763. end
  764. end
  765. elseif p[1]=="Velocity" then
  766. for i,v in pairs(p[2]) do
  767. v.Velocity=p[4];
  768. end
  769. end
  770. History.Done[#History.Done+1]=History.Undone[#History.Undone];
  771. History.Undone[#History.Undone]=nil;
  772. end
  773. end
  774.  
  775. --[[ Hook Up Guis ]]
  776. PaletteMode=1;
  777. PaletteImages={
  778. {36663907,36662758,36662760,36662767,36662771},
  779. {0,36681404,36681442,36681517,36681469},
  780. {0,36681389,36681397,36681413,36681490},
  781. {0,36681506,36681529,36681480,36681419},
  782. {0,36681407,36681526,36681456,36681429},
  783. };
  784. PaletteFunctions = PaletteFunctions or {};
  785. PaletteFunctions={
  786.  
  787. Move=PaletteFunctions.Move or (function() end),
  788. Resize=PaletteFunctions.Resize or (function() end),
  789. Rotate=PaletteFunctions.Rotate or (function() end),
  790. Lock=PaletteFunctions.Lock or (function() end),
  791. Color=PaletteFunctions.Color or (function() end),
  792. Material=PaletteFunctions.Material or (function() end),
  793. Transparency=PaletteFunctions.Transparency or (function() end),
  794. Reflectance=PaletteFunctions.Reflectance or (function() end),
  795. Anchor=PaletteFunctions.Anchor or (function() end),
  796. CanCollide=PaletteFunctions.CanCollide or (function() end),
  797. FormFactor=PaletteFunctions.FormFactor or (function() end),
  798. Shape=PaletteFunctions.Shape or (function() end),
  799. Surface=PaletteFunctions.Surface or (function() end),
  800. Velocity=PaletteFunctions.Velocity or (function() end),
  801. RotVelocity=PaletteFunctions.RotVelocity or (function() end),
  802. Friction=PaletteFunctions.Friction or (function() end),
  803. Elasticity=PaletteFunctions.Elasticity or (function() end),
  804. Utilities=PaletteFunctions.Utilities or (function() end),
  805.  
  806. Options=PaletteFunctions.Options or (function() end),
  807. Help=PaletteFunctions.Help or (function() end),
  808. };
  809. FunctionData={};
  810.  
  811. function RefreshPalette()
  812. obj3.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][2]);
  813. obj4.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][4]);
  814. obj5.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][5]);
  815. obj6.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[PaletteMode][3]);
  816. end
  817. function ActivateFunction(index)
  818. input("Unload");
  819. if PaletteMode==1 and index==1 then
  820. PaletteFunctions.Move();
  821. elseif PaletteMode==1 and index==2 then
  822. PaletteFunctions.Resize();
  823. elseif PaletteMode==1 and index==3 then
  824. PaletteFunctions.Rotate();
  825. elseif PaletteMode==1 and index==4 then
  826. PaletteFunctions.Lock();
  827. elseif PaletteMode==2 and index==1 then
  828. PaletteFunctions.Color();
  829. elseif PaletteMode==2 and index==2 then
  830. PaletteFunctions.Material();
  831. elseif PaletteMode==2 and index==3 then
  832. PaletteFunctions.Transparency();
  833. elseif PaletteMode==2 and index==4 then
  834. PaletteFunctions.Reflectance();
  835. elseif PaletteMode==3 and index==1 then
  836. PaletteFunctions.Anchor();
  837. elseif PaletteMode==3 and index==2 then
  838. PaletteFunctions.CanCollide();
  839. elseif PaletteMode==3 and index==3 then
  840. PaletteFunctions.FormFactor();
  841. elseif PaletteMode==3 and index==4 then
  842. PaletteFunctions.Shape();
  843. elseif PaletteMode==4 and index==1 then
  844. PaletteFunctions.Surface();
  845. elseif PaletteMode==4 and index==2 then
  846. PaletteFunctions.Velocity();
  847. elseif PaletteMode==4 and index==3 then
  848. PaletteFunctions.RotVelocity();
  849. elseif PaletteMode==4 and index==4 then
  850. PaletteFunctions.Friction();
  851. elseif PaletteMode==5 and index==1 then
  852. PaletteFunctions.Elasticity();
  853. elseif PaletteMode==5 and index==2 then
  854. PaletteFunctions.Utilities();
  855. elseif PaletteMode==5 and index==3 then
  856. PaletteFunctions.Options();
  857. elseif PaletteMode==5 and index==4 then
  858. PaletteFunctions.Help();
  859. end
  860. end
  861.  
  862. obj7.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[1][1]);
  863. obj8.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[2][1]);
  864. obj9.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[3][1]);
  865. obj10.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[4][1]);
  866. obj11.Image="http://www.roblox.com/asset/?id="..tostring(PaletteImages[5][1]);
  867.  
  868. function HitButton(obj)
  869. if obj==obj3 then
  870. ActivateFunction(1);
  871. elseif obj==obj4 then
  872. ActivateFunction(3);
  873. elseif obj==obj5 then
  874. ActivateFunction(4);
  875. elseif obj==obj6 then
  876. ActivateFunction(2);
  877. elseif obj==obj7 then
  878. PaletteMode=1;
  879. RefreshPalette();
  880. elseif obj==obj8 then
  881. PaletteMode=2;
  882. RefreshPalette();
  883. elseif obj==obj9 then
  884. PaletteMode=3;
  885. RefreshPalette();
  886. elseif obj==obj10 then
  887. PaletteMode=4;
  888. RefreshPalette();
  889. elseif obj==obj11 then
  890. PaletteMode=5;
  891. RefreshPalette();
  892. elseif obj==gui24 then
  893. input("Group");
  894. elseif obj==gui25 then
  895. input("Ungroup");
  896. elseif obj==gui26 then
  897. input("Apply");
  898. elseif obj==gui27 then
  899. input("Undo");
  900. elseif obj==gui28 then
  901. input("Redo");
  902. elseif obj==gui29 then
  903. input("Clone");
  904. elseif obj==gui30 then
  905. input("Delete");
  906. elseif obj==gui31 then
  907. input("Save");
  908. end
  909. end
  910.  
  911. obj3.MouseButton1Down:connect(function() HitButton(obj3); end);
  912. obj4.MouseButton1Down:connect(function() HitButton(obj4); end);
  913. obj5.MouseButton1Down:connect(function() HitButton(obj5); end);
  914. obj6.MouseButton1Down:connect(function() HitButton(obj6); end);
  915.  
  916. obj7.MouseButton1Down:connect(function() HitButton(obj7); end);
  917. obj8.MouseButton1Down:connect(function() HitButton(obj8); end);
  918. obj9.MouseButton1Down:connect(function() HitButton(obj9); end);
  919. obj10.MouseButton1Down:connect(function() HitButton(obj10); end);
  920. obj11.MouseButton1Down:connect(function() HitButton(obj11); end);
  921.  
  922. gui24.MouseButton1Down:connect(function() HitButton(gui24); end);
  923. gui25.MouseButton1Down:connect(function() HitButton(gui25); end);
  924. gui26.MouseButton1Down:connect(function() HitButton(gui26); end);
  925. gui27.MouseButton1Down:connect(function() HitButton(gui27); end);
  926. gui28.MouseButton1Down:connect(function() HitButton(gui28); end);
  927. gui29.MouseButton1Down:connect(function() HitButton(gui29); end);
  928. gui30.MouseButton1Down:connect(function() HitButton(gui30); end);
  929. gui31.MouseButton1Down:connect(function() HitButton(gui31); end);
  930.  
  931. RefreshPalette();
  932.  
  933. --[[gui_drag=nil;
  934. dragger_gui.BackgroundTransparency=.5;
  935. dragger_gui.Parent=obj1;
  936. GuiDrag={
  937. function Down(gui)
  938. dragger_gui.Size=gui.Size;
  939. dragger_gui.BackgroundColor3=gui.BackgroundColor3;
  940. end,
  941. }
  942. gui2.MouseButton1Down:connect(function() gui_drag=gui2; end)
  943. gui4.MouseButton1Down:connect(function() gui_drag=gui2; end)
  944. gui5.MouseButton1Down:connect(function() gui_drag=gui2; end)
  945. ]]
  946.  
  947. --[[
  948.  
  949. void keys.down(k as Integer)
  950. void keys.up(k as Integer)
  951. bool keys.check(k as Integer)
  952.  
  953. ]]
  954.  
  955. keys={
  956.  
  957. down=function(k)
  958. table.insert(keys.list,k);
  959. end,
  960.  
  961. up=function(k)
  962. for i=#keys.list,1,-1 do
  963. if keys.list[i]==k then
  964. table.remove(keys.list,i);
  965. end
  966. end
  967. end,
  968.  
  969. check=function(k)
  970. for i,v in pairs(keys.list) do
  971. if k==v then
  972. return true;
  973. end
  974. end
  975. return false;
  976. end,
  977.  
  978. list={}
  979. }
  980.  
  981. PaletteFunctions = PaletteFunctions or {};
  982.  
  983. function PaletteFunctions.Lock()
  984.  
  985. function Active(p) --p accepts a table of parameters.
  986. local c=p[1]; --c is command.
  987. if c=="Unload" then
  988. obj40.Parent=nil;
  989. return;
  990. elseif c=="KeyDown" then
  991. if string.byte(p[3])==9 then
  992. HitButton(gui26);
  993. end
  994. Passive(p);
  995. return;
  996. elseif c=="Apply" then
  997. prior={};
  998. parts=HasPermission(GetParts(Selection.Get()), "lock");
  999. for i,v in pairs(parts) do
  1000. prior[i]=v.Locked;
  1001. v.Locked=FunctionData.Lock.Mode;
  1002. end
  1003. History.Action("Lock", parts, prior, FunctionData.Lock.Mode);
  1004. return;
  1005. else
  1006. Passive(p);
  1007. end
  1008. end
  1009.  
  1010. FunctionData.Lock = FunctionData.Lock or {};
  1011. FunctionData.Lock.Mode = FunctionData.Lock.Mode or false;
  1012.  
  1013. 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)
  1014. 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)
  1015. 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)
  1016. obj40.Parent=obj1;
  1017.  
  1018. obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1019. obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1020.  
  1021. obj41.MouseButton1Down:connect(function()
  1022. FunctionData.Lock.Mode = true;
  1023. obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1024. obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1025. end)
  1026. obj42.MouseButton1Down:connect(function()
  1027. FunctionData.Lock.Mode = false;
  1028. obj41.BackgroundColor3 = FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1029. obj42.BackgroundColor3 = not FunctionData.Lock.Mode and Options.SelectedColor or Options.ButtonColor;
  1030. end)
  1031.  
  1032.  
  1033. end
  1034.  
  1035. PaletteFunctions = PaletteFunctions or {};
  1036.  
  1037. function PaletteFunctions.Material()
  1038.  
  1039. mouse_over=0;
  1040. function Active(p) --p accepts a table of parameters.
  1041. local c=p[1]; --c is command.
  1042. if c=="Unload" then
  1043. obj40.Parent=nil;
  1044. return;
  1045. elseif c=="KeyDown" then
  1046. if string.byte(p[3])==9 then
  1047. HitButton(gui26);
  1048. end
  1049. Passive(p);
  1050. elseif c=="Move" then
  1051. local obj50=obj50;
  1052. Spawn(function()
  1053. mouse_over=mouse_over+1;
  1054. obj50.BackgroundTransparency=1;
  1055. obj50.TextTransparency=1;
  1056. if p[2].Target~=nil then
  1057. local mo=mouse_over;
  1058. if mo==mouse_over and Options.ToolTipText=="on" then
  1059. wait(.75)
  1060. end
  1061. if mo==mouse_over then
  1062. obj50.Text=string.sub(tostring(p[2].Target.Material), 15);
  1063. obj50.Position=UDim2.new(0,p[2].X-obj40.AbsolutePosition.x,0,p[2].Y-obj40.AbsolutePosition.y-obj50.AbsoluteSize.y);
  1064. if Options.ToolTipText=="immediate" then
  1065. obj50.BackgroundTransparency=0;
  1066. obj50.TextTransparency=0;
  1067. end
  1068. end
  1069. if Options.ToolTipText=="on" then
  1070. for transparency=1,0,-.05 do
  1071. if mo==mouse_over then
  1072. obj50.BackgroundTransparency=transparency;
  1073. obj50.TextTransparency=transparency;
  1074. wait();
  1075. end
  1076. end
  1077. if mo==mouse_over then
  1078. obj50.BackgroundTransparency=0;
  1079. obj50.TextTransparency=0;
  1080. end
  1081. end
  1082. end
  1083. end)
  1084. Passive(p);
  1085. return;
  1086. elseif c=="Apply" then
  1087. prior={};
  1088. new=nil;
  1089. parts=HasPermission(GetParts(Selection.Get()), "material");
  1090. for i,v in pairs(parts) do
  1091. prior[i]=v.Material;
  1092. v.Material = FunctionData.Material.Choice;
  1093. end
  1094. History.Action("Material", parts, prior, FunctionData.Material.Choice);
  1095. return;
  1096. else
  1097. Passive(p);
  1098. end
  1099. end
  1100.  
  1101. FunctionData.Material = FunctionData.Material or {};
  1102. FunctionData.Material.Choice = FunctionData.Material.Choice or Enum.Material.Plastic;
  1103. 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)
  1104. 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)
  1105. 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)
  1106. 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)
  1107. 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)
  1108. 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)
  1109. 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)
  1110. 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)
  1111. 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)
  1112. 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)
  1113. obj40.Parent=obj1;
  1114. 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
  1115.  
  1116. function RefreshMaterials()
  1117. for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48, obj49}) do
  1118. if Enum.Material[v.Name] == FunctionData.Material.Choice then
  1119. v.BorderColor3=Options.SelectedColor;
  1120. else
  1121. v.BorderColor3=Color3.new(0,0,0);
  1122. end
  1123. end
  1124. end
  1125.  
  1126. for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48, obj49}) do
  1127. v.MouseButton1Down:connect(function()
  1128. FunctionData.Material.Choice = Enum.Material[v.Name];
  1129. RefreshMaterials();
  1130. end)
  1131. v.MouseMoved:connect(function(x,y)
  1132. local obj50=obj50;
  1133. mouse_over=mouse_over+1;
  1134. obj50.BackgroundTransparency=1;
  1135. obj50.TextTransparency=1;
  1136. if true then
  1137. local mo=mouse_over;
  1138. if mo==mouse_over and Options.ToolTipText=="on" then
  1139. wait(.75)
  1140. end
  1141. if mo==mouse_over then
  1142. obj50.Text=v.Name;
  1143. obj50.Position=UDim2.new(0,x-obj40.AbsolutePosition.x,0,y-obj40.AbsolutePosition.y-obj50.AbsoluteSize.y);
  1144. if Options.ToolTipText=="immediate" then
  1145. obj50.BackgroundTransparency=0;
  1146. obj50.TextTransparency=0;
  1147. end
  1148. end
  1149. if Options.ToolTipText=="on" then
  1150. for transparency=1,0,-.05 do
  1151. if mo==mouse_over then
  1152. obj50.BackgroundTransparency=transparency;
  1153. obj50.TextTransparency=transparency;
  1154. wait();
  1155. end
  1156. end
  1157. if mo==mouse_over then
  1158. obj50.BackgroundTransparency=0;
  1159. obj50.TextTransparency=0;
  1160. end
  1161. end
  1162. end
  1163. end)
  1164. end
  1165.  
  1166. end
  1167.  
  1168. function PaletteFunctions.Move()
  1169.  
  1170. function Active(p) --p accepts a table of parameters.
  1171. local c=p[1]; --c is command.
  1172. if c=="Unload" then
  1173. FunctionData.Move.x = tonumber(obj42.Text) or 0;
  1174. FunctionData.Move.y = tonumber(obj44.Text) or 0;
  1175. FunctionData.Move.z = tonumber(obj46.Text) or 0;
  1176. TB.remove(obj41);
  1177. TB.remove(obj43);
  1178. TB.remove(obj45);
  1179. aabb.Parent=nil;
  1180. handles.Parent=nil;
  1181. sb.Parent=nil;
  1182. axes_x.Parent=nil;
  1183. axes_y.Parent=nil;
  1184. axes_z.Parent=nil;
  1185. obj40.Parent=nil;
  1186. return;
  1187. elseif c=="KeyDown" then
  1188. if string.byte(p[3])==9 then
  1189. HitButton(gui26);
  1190. Spawn(function()
  1191. local t = tab_index;
  1192. wait(Options.RepeatDelay);
  1193. while keys.check(9) and t==tab_index do
  1194. HitButton(gui26);
  1195. wait(Options.RepeatRate);
  1196. end
  1197. end);
  1198. end
  1199. Passive(p);
  1200. UpdateHandles();
  1201. elseif c=="KeyUp" then
  1202. if string.byte(p[3])==9 then
  1203. tab_index = tab_index + 1;
  1204. end
  1205. Passive(p);
  1206. elseif c=="Move" then
  1207. if pending_target then
  1208. sb.Adornee=p[2].Target;
  1209. else
  1210. Passive(p);
  1211. end
  1212. elseif c=="Button1Down" then
  1213. if pending_target then
  1214. FunctionData.Move.TargetAxis = p[2].Target;
  1215. pending_target=false;
  1216. if pending_target then
  1217. obj51.Text = "Pending Selection...";
  1218. elseif FunctionData.Move.TargetAxis then
  1219. obj51.Text = "Axes Alignment Chosen";
  1220. else
  1221. obj51.Text = "No Reference Part";
  1222. end
  1223. sb.Visible=false;
  1224. else
  1225. aabb.Parent=nil;
  1226. handles.Visible=false;
  1227. axes_x.Parent=nil;
  1228. axes_y.Parent=nil;
  1229. axes_z.Parent=nil;
  1230. Passive(p);
  1231. UpdateHandles();
  1232. end
  1233. elseif c=="Apply" then
  1234. FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  1235. FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  1236. FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  1237. prior={};
  1238. after={};
  1239. p=HasPermission(GetParts(Selection.Get()), "move");
  1240. if FunctionData.Move.TargetAxis then
  1241. for i,v in pairs(p) do
  1242. prior[i]=v.CFrame;
  1243. 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;
  1244. after[i]=v.CFrame;
  1245. end
  1246. elseif FunctionData.Move.WorldAxis then
  1247. for i,v in pairs(p) do
  1248. prior[i]=v.CFrame;
  1249. v.CFrame = CFrame.new(FunctionData.Move.x, FunctionData.Move.y, FunctionData.Move.z) * v.CFrame;
  1250. after[i]=v.CFrame;
  1251. end
  1252. elseif not FunctionData.Move.WorldAxis then
  1253. for i,v in pairs(p) do
  1254. prior[i]=v.CFrame;
  1255. v.CFrame = v.CFrame * CFrame.new(FunctionData.Move.x, FunctionData.Move.y, FunctionData.Move.z);
  1256. after[i]=v.CFrame;
  1257. end
  1258. end
  1259. History.Action("Move", p, prior, after);
  1260. pending_target=false;
  1261. Passive(p);
  1262. UpdateHandles();
  1263. elseif c=="Button1Up" then
  1264. aabb.Parent=LocalBin;
  1265. axes_x.Parent=LocalBin;
  1266. axes_y.Parent=LocalBin;
  1267. axes_z.Parent=LocalBin;
  1268. HandlesUp();
  1269. Passive(p);
  1270. UpdateHandles();
  1271. handles.Visible=true;
  1272. else
  1273. Passive(p);
  1274. end
  1275. end
  1276.  
  1277. tab_index = 0;
  1278.  
  1279. FunctionData.Move = FunctionData.Move or {};
  1280.  
  1281. FunctionData.Move.x = FunctionData.Move.x or 0;
  1282. FunctionData.Move.y = FunctionData.Move.y or 0;
  1283. FunctionData.Move.z = FunctionData.Move.z or 0;
  1284. if FunctionData.Move.WorldAxis==nil then
  1285. FunctionData.Move.WorldAxis = true;
  1286. end
  1287.  
  1288. 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
  1289. 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
  1290. 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)
  1291. 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
  1292. 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)
  1293. 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
  1294. 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)
  1295. 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)
  1296. 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)
  1297. 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)
  1298. 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)
  1299. 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)
  1300. obj42.Text = FunctionData.Move.x;
  1301. obj44.Text = FunctionData.Move.y;
  1302. obj46.Text = FunctionData.Move.z;
  1303. obj40.Parent=obj1;
  1304.  
  1305. obj48.MouseButton1Down:connect(function()
  1306. FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  1307. FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  1308. FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  1309. FunctionData.Move.x = (FunctionData.Move.x or 0) * -1;
  1310. FunctionData.Move.y = (FunctionData.Move.y or 0) * -1;
  1311. FunctionData.Move.z = (FunctionData.Move.z or 0) * -1;
  1312. obj42.Text = FunctionData.Move.x;
  1313. obj44.Text = FunctionData.Move.y;
  1314. obj46.Text = FunctionData.Move.z;
  1315. end)
  1316. obj49.MouseButton1Down:connect(function()
  1317. FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  1318. FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  1319. FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  1320. FunctionData.Move.x = (FunctionData.Move.x or 0) * 2;
  1321. FunctionData.Move.y = (FunctionData.Move.y or 0) * 2;
  1322. FunctionData.Move.z = (FunctionData.Move.z or 0) * 2;
  1323. obj42.Text = FunctionData.Move.x;
  1324. obj44.Text = FunctionData.Move.y;
  1325. obj46.Text = FunctionData.Move.z;
  1326. end)
  1327. obj50.MouseButton1Down:connect(function()
  1328. FunctionData.Move.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  1329. FunctionData.Move.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  1330. FunctionData.Move.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  1331. FunctionData.Move.x = (FunctionData.Move.x or 0) * 0.5;
  1332. FunctionData.Move.y = (FunctionData.Move.y or 0) * 0.5;
  1333. FunctionData.Move.z = (FunctionData.Move.z or 0) * 0.5;
  1334. obj42.Text = FunctionData.Move.x;
  1335. obj44.Text = FunctionData.Move.y;
  1336. obj46.Text = FunctionData.Move.z;
  1337. end)
  1338.  
  1339. sb=Instance.new("SelectionBox");
  1340. sb.Name="PendingDistinguisher";
  1341. sb.Color=Options.ActiveSelectionBoxColor;
  1342. sb.Visible=false;
  1343. sb.Parent=obj1;
  1344. handles=Instance.new("Handles");
  1345. handles.Color=Options.DragHandlesColor;
  1346. handles.Parent=obj1;
  1347. aabb=Instance.new("Part");
  1348. aabb.Anchored=true;
  1349. aabb.CanCollide=false;
  1350. aabb.Transparency=1;
  1351. aabb.Parent=LocalBin;
  1352. aabb.Name="AABB";
  1353.  
  1354. axes_x=Instance.new("Part");
  1355. axes_x.Anchored=true;
  1356. axes_x.CanCollide=false;
  1357. axes_x.Transparency=1;
  1358. Instance.new("CylinderMesh").Parent=axes_x;
  1359. axes_x.Name="axes_x";
  1360. axes_x.formFactor=0;
  1361. axes_x.Size=Vector3.new(1, 3, 1);
  1362. axes_x.BrickColor=BrickColor.new("Bright yellow");
  1363. axes_x.Parent=LocalBin;
  1364.  
  1365. axes_y=Instance.new("Part");
  1366. axes_y.Anchored=true;
  1367. axes_y.CanCollide=false;
  1368. axes_y.Transparency=1;
  1369. Instance.new("CylinderMesh").Parent=axes_y;
  1370. axes_y.Name="axes_x";
  1371. axes_y.formFactor=0;
  1372. axes_y.Size=Vector3.new(1, 3, 1);
  1373. axes_y.BrickColor=BrickColor.new("Cyan");
  1374. axes_y.Parent=LocalBin;
  1375.  
  1376. axes_z=Instance.new("Part");
  1377. axes_z.Anchored=true;
  1378. axes_z.CanCollide=false;
  1379. axes_z.Transparency=1;
  1380. Instance.new("CylinderMesh").Parent=axes_z;
  1381. axes_z.Name="axes_x";
  1382. axes_z.formFactor=0;
  1383. axes_z.Size=Vector3.new(1, 3, 1);
  1384. axes_z.BrickColor=BrickColor.new("Magenta");
  1385. axes_z.Parent=LocalBin;
  1386.  
  1387. function UpdateHandles()
  1388. if #HasPermission(GetParts(Selection.Get()),"handles_drag")==1 and not FunctionData.Move.WorldAxis and not FunctionData.Move.TargetAxis then
  1389. local p=HasPermission(GetParts(Selection.Get()),"handles_drag")[1];
  1390. handles.Adornee=p;
  1391. if Options.ThreeAxes then
  1392. axes_x.Transparency=0;
  1393. axes_y.Transparency=0;
  1394. axes_z.Transparency=0;
  1395. 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);
  1396. axes_y.CFrame=p.CFrame*CFrame.new(0, p.Size.y/2+axes_y.Size.y/2,0);
  1397. 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);
  1398. end
  1399. elseif #Selection.Get()==0 then
  1400. handles.Adornee=nil;
  1401. axes_x.Transparency=1;
  1402. axes_y.Transparency=1;
  1403. axes_z.Transparency=1;
  1404. elseif FunctionData.Move.TargetAxis then
  1405. min, max, _min, _max = angledAABB(GetParts(Selection.Get()), FunctionData.Move.TargetAxis.CFrame);
  1406. aabb.Size = _max - _min;
  1407. aabb.CFrame = CFrame.new(min:lerp(max, .5)) * (FunctionData.Move.TargetAxis.CFrame - FunctionData.Move.TargetAxis.Position);
  1408. handles.Adornee=aabb;
  1409. if Options.ThreeAxes then
  1410. axes_x.Transparency=0;
  1411. axes_y.Transparency=0;
  1412. axes_z.Transparency=0;
  1413. 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);
  1414. axes_y.CFrame=aabb.CFrame*CFrame.new(0, aabb.Size.y/2+axes_y.Size.y/2,0);
  1415. 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);
  1416. end
  1417. else
  1418. min, max = getAABB(GetParts(Selection.Get()));
  1419. aabb.Size = max - min;
  1420. aabb.CFrame = CFrame.new(min:lerp(max, .5));
  1421. handles.Adornee=aabb;
  1422. if Options.ThreeAxes then
  1423. axes_x.Transparency=0;
  1424. axes_y.Transparency=0;
  1425. axes_z.Transparency=0;
  1426. 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);
  1427. axes_y.CFrame=aabb.CFrame*CFrame.new(0, aabb.Size.y/2+axes_y.Size.y/2,0);
  1428. 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);
  1429. end
  1430. end
  1431. end;
  1432. UpdateHandles();
  1433.  
  1434. round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
  1435.  
  1436. function HandlesUp()
  1437. if #original_locations>0 and handles_dragging_parts then
  1438. final_locations={};
  1439. for i,v in pairs(handles_dragging_parts) do
  1440. final_locations[#final_locations + 1] = v.CFrame;
  1441. end
  1442. History.Action("Move", handles_dragging_parts, original_locations, final_locations);
  1443. original_locations={};
  1444. end
  1445. end;
  1446.  
  1447. handles_dragging_parts={};
  1448. old_distance=0;
  1449. original_locations={};
  1450. final_locations={};
  1451. handles.MouseButton1Down:connect(function()
  1452. handles_dragging_parts=HasPermission(GetParts(Selection.Get()), "handles_drag")
  1453. original_locations={};
  1454. for i,v in pairs(handles_dragging_parts) do
  1455. original_locations[#original_locations + 1] = v.CFrame;
  1456. end
  1457. old_distance = 0;
  1458. end)
  1459. handles.MouseButton1Up:connect(HandlesUp)
  1460. handles.MouseDrag:connect(function(face, dist)
  1461. new_distance = round(dist - old_distance, Options.MoveDragIntervals);
  1462. old_distance = old_distance + new_distance;
  1463. if new_distance~=0 then
  1464. local faces=Vector3.new();
  1465. if face==Enum.NormalId.Left then
  1466. faces=Vector3.new(-1, 0, 0);
  1467. elseif face==Enum.NormalId.Right then
  1468. faces=Vector3.new(1, 0, 0);
  1469. elseif face==Enum.NormalId.Top then
  1470. faces=Vector3.new(0, 1, 0);
  1471. elseif face==Enum.NormalId.Bottom then
  1472. faces=Vector3.new(0, -1, 0);
  1473. elseif face==Enum.NormalId.Front then
  1474. faces=Vector3.new(0, 0, -1);
  1475. elseif face==Enum.NormalId.Back then
  1476. faces=Vector3.new(0, 0, 1);
  1477. end
  1478. if handles.Adornee==aabb then
  1479. for i,v in pairs(handles_dragging_parts) do
  1480. v.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(v.CFrame);
  1481. end
  1482. axes_x.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_x.CFrame);
  1483. axes_y.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_y.CFrame);
  1484. axes_z.CFrame=CFrame.new(((aabb.CFrame-aabb.Position)*CFrame.new(faces * new_distance)).p)*(axes_z.CFrame);
  1485. aabb.CFrame=aabb.CFrame*CFrame.new(faces * new_distance);
  1486. else
  1487. for i,v in pairs(handles_dragging_parts) do
  1488. v.CFrame=v.CFrame*CFrame.new(faces * new_distance);
  1489. end
  1490. UpdateHandles();
  1491. end
  1492. end
  1493. end)
  1494.  
  1495. TB.insert(obj41, obj42);
  1496. TB.insert(obj43, obj44);
  1497. TB.insert(obj45, obj46);
  1498.  
  1499. obj47.MouseButton1Down:connect(function()
  1500. FunctionData.Move.WorldAxis = not FunctionData.Move.WorldAxis;
  1501. obj47.Text=FunctionData.Move.WorldAxis and "World Axis" or "Object Axis";
  1502. end)
  1503. pending_target = false;
  1504. obj51.MouseButton1Down:connect(function()
  1505. pending_target = not pending_target;
  1506. if pending_target then
  1507. sb.Visible=true;
  1508. obj51.Text = "Pending Selection...";
  1509. else
  1510. sb.Visible=false;
  1511. FunctionData.Move.TargetAxis = nil;
  1512. obj51.Text = "No Reference Part";
  1513. end
  1514. end)
  1515.  
  1516. function angledAABB(parts, cframe)
  1517. if type(parts)~="table" then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
  1518. if #parts==0 then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
  1519. --local min=parts[1].Position
  1520. --local max=parts[1].Position
  1521. local min=Vector3.new(math.huge, math.huge, math.huge);
  1522. local max=Vector3.new(-math.huge, -math.huge, -math.huge);
  1523. for i,v in pairs(parts) do
  1524. for x=-1,1,2 do
  1525. for y=-1,1,2 do
  1526. for z=-1,1,2 do
  1527. local s=v.Size/2;
  1528. local p = (v.CFrame * CFrame.new(x*s.x, y*s.y, z*s.z)).p;
  1529. 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))
  1530. 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))
  1531. end
  1532. end
  1533. end
  1534. end
  1535. 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
  1536. end
  1537.  
  1538. end
  1539.  
  1540. --[[Options]]
  1541.  
  1542. PaletteFunctions = PaletteFunctions or {};
  1543.  
  1544. function PaletteFunctions.Options()
  1545.  
  1546. function Active(p) --p accepts a table of parameters.
  1547. local c=p[1]; --c is command.
  1548. if c=="Unload" then
  1549. if obj60~=nil then obj60.Parent=nil; end
  1550. if f~=nil then f.Parent=nil; end
  1551. obj40.Parent=nil;
  1552. return;
  1553. elseif c=="Move" then
  1554. if obj66~=nil and obj66.Name=="ToolTipDisplay" then obj66.Visible=false; end
  1555. Passive(p);
  1556. return;
  1557. else
  1558. Passive(p);
  1559. end
  1560. end
  1561.  
  1562. 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;
  1563. 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
  1564. 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;
  1565. 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;
  1566. 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;
  1567. 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;
  1568. 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;
  1569. 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;
  1570. 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;
  1571. 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;
  1572. 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;
  1573. 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;
  1574. 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;
  1575. 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;
  1576. 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;
  1577. 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;
  1578. 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;
  1579. 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;
  1580. 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;
  1581. 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;
  1582. obj40.Parent=gui;
  1583.  
  1584. brickcolors={
  1585. {obj45, "Bounding Box Color", "BoundingBoxColor", "Determines the color of the selection boxes that surround selected parts."},
  1586. {obj46, "Active Selection Color", "ActiveSelectionBoxColor", "Determines the color of the selection box that is used when choosing a part."},
  1587. {obj47, "Drag Handles Color", "DragHandlesColor", "Determines the color of the dragging handles for movement."},
  1588. {obj48, "Rotate Handles Color", "RotateHandlesColor", "Determines the color of the dragging handles for rotation."},
  1589. {obj49, "Resize Handles Color", "ResizeHandlesColor", "Determines the color of the dragging handles for resizing."},
  1590. {obj50, "Surface Selection Color", "SurfaceSelectionColor", "Determines the color of the selection panel that is used when selecting a surface of a part."},
  1591. }
  1592. 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"};
  1593. numbers={
  1594. {obj42, "Repeat Delay", "RepeatDelay", "The amount of time that elapses before the tab button begins to repeat."},
  1595. {obj43, "Repeat Rate", "RepeatRate", "The amount of time between tab hits."},
  1596. {obj44, "Double Click Speed", "DoubleClickSpeed", "How quickly you have to double click in order to select the target's parent."},
  1597. {obj57, "Resize Increments", "ResizeDragIntervals", "The factor by which you'll resize when clicking and dragging on a handle."},
  1598. {obj58, "MoveIncrements", "MoveDragIntervals", "The factor by which you'll move when clicking and dragging on a handle."},
  1599. {obj59, "RotateIncrements", "RotateDragIntervals", "The factor by which you'll rotate when clicking and dragging on a handle."},
  1600. }
  1601. boolean={
  1602. {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."},
  1603. {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."},
  1604. {obj56, "Three Axes", function(bool) return (bool and "on" or "off"); end, "ThreeAxes", "Determines if the three axes indicators are turned on."},
  1605. }
  1606. --toggle is used for text properties that have a select series of values.
  1607. toggle={
  1608. {obj55, "Tool Tip Text", "ToolTipText", "Determines if you can hover over colors and materials to identify their name.", {"off", "on", "immediate"}},
  1609. }
  1610. vector3={
  1611. {obj51, "Smallest Size", "SmallestSize", "The smallest size you can resize a part to when dragging. Type in 3 numbers separated by commas."},
  1612. }
  1613.  
  1614. UpdateButtons=function()
  1615. for i,v in pairs(vector3) do
  1616. v[1].Text=v[2] .. ": " .. tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
  1617. end
  1618. for i,v in pairs(numbers) do
  1619. v[1].Text=v[2] .. ": " .. tostring(Options[v[3]]);
  1620. end
  1621. for i,v in pairs(toggle) do
  1622. v[1].Text=v[2]..": "..Options[v[3]];
  1623. end
  1624. for i,v in pairs(brickcolors) do
  1625. v[1].Text=v[2]..": "..Options[v[3]].Name;
  1626. end
  1627. for i,v in pairs(boolean) do
  1628. v[1].Text=v[2] .. ": " .. v[3](Options[v[4]]);
  1629. end
  1630. end;
  1631.  
  1632. for i,v in pairs(vector3) do
  1633. v[1].Text=v[2] .. ": " .. tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
  1634. v[1].MouseButton1Down:connect(function()
  1635. if obj60~=nil then obj60.Parent=nil; end
  1636. 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;
  1637. 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;
  1638. 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;
  1639. 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;
  1640. 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";
  1641. obj60.Parent=gui;
  1642. obj61.Text=tostring(Options[v[3]].x) .. ", " .. tostring(Options[v[3]].y) .. ", " .. tostring(Options[v[3]].z);
  1643. obj62.Text=v[2];
  1644. obj63.Text=v[4];
  1645. obj64.MouseButton1Down:connect(function()
  1646. entry=obj61.Text;
  1647. f1=string.find(entry, ",");
  1648. if f1~=nil then
  1649. x=string.gsub(string.sub(entry, 1, f1-1), " ", ""); x=tonumber(x) or 1;
  1650. entry=string.sub(entry, f1+1);
  1651. f1=string.find(entry, ",");
  1652. if f1~=nil then
  1653. y=string.gsub(string.sub(entry, 1, f1-1), " ", ""); y=tonumber(y) or 1;
  1654. z=string.gsub(string.sub(entry, f1+1), " ", ""); z=tonumber(z) or 1;
  1655. Options[v[3]]=Vector3.new(x,y,z);
  1656. else
  1657. Options[v[3]]=Vector3.new(1,x,1);
  1658. end
  1659. else
  1660. Options[v[3]]=Vector3.new(1,1,1);
  1661. end
  1662. UpdateButtons();
  1663. if obj60~=nil then obj60.Parent=nil; end
  1664. end)
  1665. end)
  1666. end
  1667.  
  1668. for i,v in pairs(numbers) do
  1669. v[1].Text=v[2] .. ": " .. tostring(Options[v[3]]);
  1670. v[1].MouseButton1Down:connect(function()
  1671. if obj60~=nil then obj60.Parent=nil; end
  1672. 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;
  1673. 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;
  1674. 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;
  1675. 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;
  1676. 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";
  1677. obj60.Parent=gui;
  1678. obj61.Text=Options[v[3]];
  1679. obj62.Text=v[2];
  1680. obj63.Text=v[4];
  1681. obj64.MouseButton1Down:connect(function()
  1682. Options[v[3]]=math.abs(tonumber(obj61.Text=="" and "0" or obj61.Text) or 0);
  1683. UpdateButtons();
  1684. if obj60~=nil then obj60.Parent=nil; end
  1685. end)
  1686. end)
  1687. end
  1688.  
  1689. for i,v in pairs(boolean) do
  1690. v[1].Text=v[2] .. ": " .. v[3](Options[v[4]]);
  1691. v[1].MouseButton1Down:connect(function()
  1692. if obj60~=nil then obj60.Parent=nil; end
  1693. 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;
  1694. 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
  1695. 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;
  1696. 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;
  1697. 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";
  1698. obj60.Parent=gui;
  1699. obj61.Text=v[3](Options[v[4]]);
  1700. obj62.Text=v[2];
  1701. obj63.Text=v[5];
  1702. obj61.MouseButton1Down:connect(function()
  1703. Options[v[4]]=not Options[v[4]]
  1704. obj61.Text=v[3](Options[v[4]]);
  1705. end)
  1706. obj64.MouseButton1Down:connect(function()
  1707. UpdateButtons();
  1708. if obj60~=nil then obj60.Parent=nil; end
  1709. end)
  1710. end)
  1711. end
  1712.  
  1713. for i,v in pairs(toggle) do
  1714. v[1].Text=v[2]..": "..Options[v[3]];
  1715. v[1].MouseButton1Down:connect(function()
  1716. if obj60~=nil then obj60.Parent=nil; end
  1717. 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;
  1718. 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
  1719. 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;
  1720. 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;
  1721. 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";
  1722. obj60.Parent=gui;
  1723. obj61.Text=(Options[v[3]]);
  1724. obj62.Text=v[2];
  1725. obj63.Text=v[4];
  1726. obj61.MouseButton1Down:connect(function()
  1727. for a,b in pairs(v[5]) do
  1728. if b==Options[v[3]] then
  1729. index=a;
  1730. end
  1731. end
  1732. index=index+1;
  1733. if v[5][index]==nil then index=1 end
  1734. Options[v[3]]=v[5][index];
  1735. obj61.Text=(Options[v[3]]);
  1736. end)
  1737. obj64.MouseButton1Down:connect(function()
  1738. UpdateButtons();
  1739. if obj60~=nil then obj60.Parent=nil; end
  1740. end)
  1741. end)
  1742. end
  1743.  
  1744. for i,v in pairs(brickcolors) do
  1745. v[1].Text=v[2]..": "..Options[v[3]].Name;
  1746. v[1].MouseButton1Down:connect(function()
  1747. if obj60~=nil then obj60.Parent=nil; end
  1748. 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;
  1749. 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
  1750. 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;
  1751. 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;
  1752. 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";
  1753. obj60.Parent=gui;
  1754. obj61.Text=Options[v[3]].Name;
  1755. obj62.Text=v[2];
  1756. obj63.Text=v[4];
  1757. obj61.MouseButton1Down:connect(function(x,y)
  1758. f=Instance.new("Frame");
  1759. 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
  1760. f.Position=UDim2.new(0, x, 0, y);
  1761. f.Parent=gui;
  1762. for i=0,142,1 do
  1763. local tile=Instance.new("TextButton")
  1764. tile.BorderColor3=Color3.new(8/255,8/255,8/255)
  1765. tile.Name=tostring(i+1)
  1766. tile.Position=UDim2.new(0,2+(i%13)*17,0,2+(math.floor(i/13))*17)
  1767. tile.Size=UDim2.new(0,19,0,19)
  1768. tile.Text=""
  1769. tile.BackgroundColor3=BrickColor.new(all_colors[i+1]).Color
  1770. tile.MouseButton1Down:connect(function()
  1771. Options[v[3]]=BrickColor.new(all_colors[tonumber(tile.Name)]);
  1772. f.Parent=nil;
  1773. end)
  1774. tile.Parent=f
  1775. end
  1776. obj61.Text=(Options[v[3]].Name);
  1777. end)
  1778. obj64.MouseButton1Down:connect(function()
  1779. UpdateButtons();
  1780. if obj60~=nil then obj60.Parent=nil; end
  1781. end)
  1782. end)
  1783. end
  1784.  
  1785. obj53.MouseButton1Down:connect(function()
  1786. if obj60~=nil then obj60.Parent=nil; end
  1787. PermissionsIndex=1;
  1788. PermissionsGiven=true;
  1789. permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
  1790. obj60=Instance.new("Frame") obj60.Position=UDim2.new(0.5,-57,0.5,-35) obj60.Size=UDim2.new(0,130,0,78)
  1791. 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)
  1792. 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="<"
  1793. 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=">"
  1794. 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"
  1795. 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"
  1796. 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";
  1797. obj60.BackgroundColor3=Options.MainColor;
  1798. obj61.BackgroundColor3=Options.ButtonColor;
  1799. obj62.BackgroundColor3=Options.ButtonColor;
  1800. obj63.BackgroundColor3=Options.ButtonColor;
  1801. obj64.BackgroundColor3=Options.ButtonColor;
  1802. obj65.BackgroundColor3=Options.ButtonColor;
  1803. local buttons={};
  1804. local Refresh=function()
  1805. if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=#game.Players:GetChildren(); end
  1806. permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
  1807. obj61.Text=permissionsTarget.Name;
  1808. if PermissionsGiven then
  1809. for i,v in pairs(buttons) do
  1810. v.Text=UserPermission(permissionsTarget, game.Players.LocalPlayer, _possible_permissions[tonumber(v.Name)]) and "X" or " ";
  1811. end
  1812. else
  1813. v.Text=UserPermission(game.Players.LocalPlayer, permissionsTarget, _possible_permissions[tonumber(v.Name)]) and "X" or " ";
  1814. end
  1815. end;
  1816. 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"};
  1817. for x=1,8 do
  1818. for y=1,3 do
  1819. local button=Instance.new("TextButton");
  1820. button.Name=tostring((y-1)*8+x);
  1821. button.Position=UDim2.new(0,2+(x-1)*16,0,16+(y-1)*16);
  1822. button.Size=UDim2.new(0,14,0,14);
  1823. button.BackgroundColor3=Options.ButtonColor;
  1824. button.Parent=obj60;
  1825. button.Text=UserPermission(permissionsTarget, game.Players.LocalPlayer, _possible_permissions[(y-1)*8+x]) and "X" or " ";
  1826. buttons[#buttons+1]=button;
  1827. button.MouseMoved:connect(function(x,y)
  1828. obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
  1829. obj66.Text=descriptions[tonumber(button.Name)];
  1830. obj66.Visible=true;
  1831. end)
  1832. button.MouseButton1Down:connect(function()
  1833. if not PermissionsGiven then
  1834. PermissionsGiven=true;
  1835. obj64.Text=PermissionsGiven and "Given" or "Recieved";
  1836. end
  1837. if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=#game.Players:GetChildren(); end
  1838. permissionsTarget=game.Players:GetChildren()[PermissionsIndex];
  1839. if obj61.Text==permissionsTarget.Name then --just to make sure nothing unexpected is going on
  1840. permissions=game.Players.LocalPlayer:findFirstChild("BuildPermissions");
  1841. if permissions~=nil then
  1842. if permissions:findFirstChild(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)]) then
  1843. permissions[(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)])].Value=not permissions[(permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)])].Value;
  1844. else
  1845. local q=Instance.new("BoolValue");
  1846. q.Name=permissionsTarget.Name.."_".._possible_permissions[tonumber(button.Name)];
  1847. q.Value=true;
  1848. q.Parent=permissions;
  1849. end
  1850. end
  1851. end
  1852. Refresh();
  1853. end)
  1854. end
  1855. end
  1856. obj60.Parent=gui;
  1857. obj62.MouseButton1Down:connect(function()
  1858. PermissionsIndex=PermissionsIndex-1;
  1859. if PermissionsIndex<1 then PermissionsIndex=#game.Players:GetChildren(); end
  1860. Refresh();
  1861. end)
  1862. obj62.MouseMoved:connect(function(x,y)
  1863. obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
  1864. obj66.Text="Previous Player";
  1865. obj66.Visible=true;
  1866. end)
  1867. obj63.MouseButton1Down:connect(function()
  1868. PermissionsIndex=PermissionsIndex+1;
  1869. if PermissionsIndex>#game.Players:GetChildren() then PermissionsIndex=1; end
  1870. Refresh();
  1871. end)
  1872. obj63.MouseMoved:connect(function(x,y)
  1873. obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
  1874. obj66.Text="Next Player";
  1875. obj66.Visible=true;
  1876. end)
  1877. obj64.MouseButton1Down:connect(function()
  1878. PermissionsGiven=not PermissionsGiven;
  1879. obj64.Text=PermissionsGiven and "Given" or "Recieved";
  1880. end)
  1881. obj64.MouseMoved:connect(function(x,y)
  1882. obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
  1883. obj66.Text="Currently displaying: " .. (PermissionsGiven and "Permissions given to other players" or "Permissions other players have given you");
  1884. obj66.Visible=true;
  1885. end)
  1886. obj65.MouseButton1Down:connect(function()
  1887. if obj60~=nil then obj60.Parent=nil; end
  1888. end)
  1889. obj62.MouseMoved:connect(function(x,y)
  1890. obj66.Position=UDim2.new(0, x-obj60.AbsolutePosition.x, 0, y-obj60.AbsolutePosition.y-obj66.AbsoluteSize.y);
  1891. obj66.Text="Submit changes and close this window.";
  1892. obj66.Visible=true;
  1893. end)
  1894. Refresh();
  1895. end)
  1896.  
  1897. end
  1898.  
  1899. --[[ Passive ]]
  1900.  
  1901. Shortcuts={
  1902. }
  1903.  
  1904. LastClick=tick();
  1905. Click=1;
  1906. PartClicked=nil;
  1907. SelectedPart=2;
  1908. LassoSelect=false;
  1909.  
  1910. lasso=Instance.new("Frame", gui);
  1911. lasso.BackgroundColor3=Color3.new(.2, .6, 1);
  1912. lasso.BorderColor3=Color3.new(0, 0, 0);
  1913. lasso.BackgroundTransparency=.8;
  1914. lasso.Visible=false;
  1915.  
  1916. function Passive(p)
  1917. c=p[1];
  1918. if c=="KeyDown" then
  1919. keys.down(string.byte(p[3]));
  1920. if string.byte(p[3])==13 then
  1921. TB.enter();
  1922. end
  1923. if p[3]=="r" and not keys.check(48) then
  1924. Drag.Rotate(Enum.Axis.Y);
  1925. elseif p[3]=="t" and not keys.check(48) then
  1926. Drag.Rotate(Enum.Axis.X);
  1927. end
  1928. if p[3]=="z" then
  1929. if keys.check(48) then
  1930. HitButton(gui27);
  1931. else
  1932. HitButton(obj7);
  1933. HitButton(obj4);
  1934. end
  1935. elseif p[3]=="r" then
  1936. if keys.check(48) then
  1937. HitButton(gui28);
  1938. end
  1939. elseif p[3]=="g" then
  1940. if keys.check(48) then
  1941. HitButton(gui24);
  1942. end
  1943. elseif p[3]=="u" then
  1944. if keys.check(48) then
  1945. HitButton(gui25);
  1946. end
  1947. elseif p[3]=="c" then
  1948. if keys.check(48) then
  1949. HitButton(gui29);
  1950. end
  1951. elseif string.byte(p[3])==8 then
  1952. if keys.check(48) then
  1953. HitButton(gui30);
  1954. end
  1955. elseif p[3]=="q" then
  1956. HitButton(obj7);
  1957. HitButton(obj3);
  1958. elseif p[3]=="e" then
  1959. HitButton(obj7);
  1960. HitButton(obj6);
  1961. end
  1962. elseif c=="KeyUp" then
  1963. keys.up(string.byte(p[3]));
  1964. elseif c=="Button1Down" then
  1965. TB.enter();
  1966. if p[2].Target~=nil then
  1967. if tick()-LastClick>Options.DoubleClickSpeed or PartClicked==nil or p[2].Target~=PartClicked then
  1968. if not Selection.Check(p[2].Target) and keys.check(48) and Permission(p[2].Target, "select") then
  1969. Selection.Add(p[2].Target);
  1970. PartClicked=p[2].Target;
  1971. SelectedPart=1;
  1972. elseif Selection.Check(p[2].Target) and keys.check(48) then
  1973. Selection.Remove(p[2].Target);
  1974. PartClicked=p[2].Target;
  1975. SelectedPart=0;
  1976. elseif Selection.Check(p[2].Target) and not keys.check(48) and Permission(p[2].Target, "drag") then
  1977. PartClicked=nil;
  1978. SelectedPart=2;
  1979. Drag.Down(p[2].Target, (p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p, HasPermission(GetParts(Selection.Get()), "drag"));
  1980. if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
  1981. elseif not Selection.Check(p[2].Target) and not keys.check(48) and Permission(p[2].Target, "select") then
  1982. PartClicked=p[2].Target;
  1983. SelectedPart=1;
  1984. Selection.Clear();
  1985. Selection.Add(p[2].Target);
  1986. if Permission(p[2].Target, "drag") then
  1987. Drag.Down(p[2].Target, (p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p, HasPermission(GetParts(Selection.Get()), "drag"));
  1988. end
  1989. if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
  1990. elseif not Selection.Check(p[2].Target) and not p[2].Target.Locked and Permission(p[2].Target, "clone") then
  1991. --clone the part.
  1992. if p[2].Target~=nil then
  1993. local offset=(p[2].Target.CFrame:inverse()*CFrame.new(p[2].Hit.p)).p;
  1994. local k=p[2].Target:clone();
  1995. k.Name="BlobbyblobBuild_"..player.Name;
  1996. if Options.CloneShift then
  1997. x=math.abs((k.CFrame*CFrame.Angles(0,math.pi/2,0)).lookVector:Dot(Vector3.new(0,1,0)));
  1998. y=math.abs((k.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector:Dot(Vector3.new(0,1,0)));
  1999. z=math.abs(k.CFrame.lookVector:Dot(Vector3.new(0,1,0)));
  2000. if (y >= x and y >= z) then
  2001. k.CFrame=CFrame.new(0,k.Size.y,0)*k.CFrame;
  2002. elseif (x >= y and y >= z) then
  2003. k.CFrame=CFrame.new(0,k.Size.x,0)*k.CFrame;
  2004. elseif (z >= x and z >= y) then
  2005. k.CFrame=CFrame.new(0,k.Size.z,0)*k.CFrame;
  2006. end
  2007. end
  2008. k.Parent=workspace;
  2009. 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.
  2010. Selection.Clear();
  2011. Selection.Add(k);
  2012. Drag.Down(k, offset, {k});
  2013. if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
  2014. end
  2015. else
  2016. Selection.Clear();
  2017. lasso.Size=UDim2.new(0,0,0,0);
  2018. PartClicked=nil;
  2019. lasso.Visible=true;
  2020. start_pos=Vector2.new(p[2].X, p[2].Y);
  2021. local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
  2022. slope1=Vector2.new(rel.x/-rel.z, rel.y/-rel.z)
  2023. LassoSelect=true;
  2024. end
  2025. Click=1;
  2026. else
  2027. --A double click! :o
  2028. Click=Click+1;
  2029. if SelectedPart==1 and PartClicked~=nil then
  2030. Targ=PartClicked;
  2031. i=1; while i<Click and Targ.Parent~=workspace do i=i+1; Targ=Targ.Parent; end
  2032. Selection.Add(Targ);
  2033. elseif SelectedPart==0 then
  2034. Targ=PartClicked;
  2035. for i=2,Click do Targ=Targ.Parent; end
  2036. Selection.Remove(Targ);
  2037. end
  2038. end
  2039. else
  2040. lasso.Size=UDim2.new(0,0,0,0);
  2041. lasso.Visible=true;
  2042. start_pos=Vector2.new(p[2].X, p[2].Y);
  2043. local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
  2044. slope1=Vector2.new(rel.x/-rel.z, rel.y/-rel.z)
  2045. LassoSelect=true;
  2046. Selection.Clear();
  2047. Click=1;
  2048. PartClicked=nil;
  2049. end
  2050. LastClick=tick();
  2051. elseif c=="Move" then
  2052. Drag.Move(p[2].UnitRay);
  2053. if p[3]==nil then p[2].Icon=GetIcon(p[2].Target); end
  2054. if lasso.Visible then
  2055. lasso.Position=UDim2.new(0, math.min(p[2].X, start_pos.x), 0, math.min(p[2].Y, start_pos.y));
  2056. lasso.Size=UDim2.new(0, math.abs(p[2].X-start_pos.x), 0, math.abs(p[2].Y-start_pos.y));
  2057. end
  2058. elseif c=="Button1Up" then
  2059. Drag.Up();
  2060. p[2].Icon=GetIcon(p[2].Target);
  2061. if LassoSelect then
  2062. lasso.Visible=false;
  2063. LassoSelect=false;
  2064. local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(p[2].Hit.p)).p
  2065. search(slope1, Vector2.new(rel.x/-rel.z, rel.y/-rel.z), p[2]);
  2066. end
  2067. elseif c=="Undo" then
  2068. History.Undo();
  2069. elseif c=="Redo" then
  2070. History.Redo();
  2071. elseif c=="Group" then
  2072. if #Selection.Get()>1 then
  2073. local max_parent=Selection.Get()[1];
  2074. local g=Instance.new("Model");
  2075. for i,v in pairs(Selection.Get()) do
  2076. if v.Parent:IsAncestorOf(max_parent) then
  2077. max_parent = v.Parent;
  2078. end
  2079. v.Parent=g;
  2080. end
  2081. g.Parent=max_parent;
  2082. Selection.Clear();
  2083. Selection.Add(g);
  2084. end
  2085. elseif c=="Ungroup" then
  2086. for i,v in pairs(Selection.Get()) do
  2087. if v:IsA("Model") then
  2088. for a,b in pairs(v:GetChildren()) do
  2089. b.Parent=v.Parent;
  2090. Selection.Add(b);
  2091. end
  2092. v.Parent=nil;
  2093. Selection.Remove(v);
  2094. end
  2095. end
  2096. elseif c=="Delete" then
  2097. parents={};
  2098. items=HasPermission(GetParts(Selection.Get()), "delete");
  2099. for i,v in pairs(items) do
  2100. Selection.Remove(v);
  2101. parents[#parents+1]=v.Parent;
  2102. v.Parent=nil;
  2103. end
  2104. History.Action("Delete", items, parents);
  2105. elseif c=="Clone" then
  2106. local items={};
  2107. local refs={};
  2108. upward=0;
  2109. if Options.CloneShift then
  2110. for i,p in pairs(GetParts(Selection.Get())) do
  2111. x=math.abs((p.CFrame*CFrame.Angles(0,math.pi/2,0)).lookVector:Dot(Vector3.new(0,1,0)));
  2112. y=math.abs((p.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector:Dot(Vector3.new(0,1,0)));
  2113. z=math.abs(p.CFrame.lookVector:Dot(Vector3.new(0,1,0)));
  2114. if (y >= x and y >= z) then
  2115. upward=math.max(upward, p.Size.y);
  2116. elseif (x >= y and x >= z) then
  2117. upward=math.max(upward, p.Size.x);
  2118. elseif (z >= x and z >= y) then
  2119. upward=math.max(upward, p.Size.z);
  2120. end
  2121. end
  2122. end
  2123. for i,v in pairs(Selection.Get()) do
  2124. local p=v:clone();
  2125. p.Parent=workspace;
  2126. items[#items+1]=p;
  2127. end
  2128. for i,v in pairs(GetParts(items)) do
  2129. v.CFrame = CFrame.new(0, upward, 0) * v.CFrame;
  2130. v.Name="BlobbyblobBuild_"..player.Name;
  2131. refs[#refs+1]={v, v.CFrame};
  2132. end
  2133. Selection.Clear()
  2134. for i,v in pairs(items) do
  2135. Selection.Add(v);
  2136. end
  2137. History.Action("Clone", items, refs);
  2138. elseif c=="Save" then
  2139. local s=script:findFirstChild("Save");
  2140. if s~=nil then
  2141. local s=s:clone();
  2142. s.Disabled=false;
  2143. s.Parent=game.Players.LocalPlayer.Backpack;
  2144. end
  2145. end
  2146.  
  2147. local round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end
  2148. --Almost a function: Refresh Dock.
  2149. if Options.DockVisible then
  2150. gui1.Visible=true;
  2151. if #GetParts(Selection.Get())==1 then
  2152. part=GetParts(Selection.Get())[1];
  2153. local x,y,z,r00,r01,r02,r10,r11,r12,r20,r21,r22=part.CFrame:components();
  2154. gui2.Text=round(x, 1e-6);
  2155. gui4.Text=round(y, 1e-6);
  2156. gui5.Text=round(z, 1e-6);
  2157. gui7.Text=part.Size.x;
  2158. gui8.Text=part.Size.y;
  2159. gui9.Text=part.Size.z;
  2160. gui11.Text=round(r00, 1e-5);
  2161. gui12.Text=round(r01, 1e-5);
  2162. gui13.Text=round(r02, 1e-5);
  2163. gui14.Text=round(r10, 1e-5);
  2164. gui15.Text=round(r11, 1e-5);
  2165. gui16.Text=round(r12, 1e-5);
  2166. gui17.Text=round(r20, 1e-5);
  2167. gui18.Text=round(r21, 1e-5);
  2168. gui19.Text=round(r22, 1e-5);
  2169. x,y,z=part.CFrame:toEulerAnglesXYZ();
  2170. gui21.Text=round(math.deg(x), 1e-5);
  2171. gui22.Text=round(math.deg(y), 1e-5);
  2172. gui23.Text=round(math.deg(z), 1e-5);
  2173. else
  2174. gui2.Text="";
  2175. gui4.Text="";
  2176. gui5.Text="";
  2177. gui7.Text="";
  2178. gui8.Text="";
  2179. gui9.Text="";
  2180. gui11.Text="";
  2181. gui12.Text="";
  2182. gui13.Text="";
  2183. gui14.Text="";
  2184. gui15.Text="";
  2185. gui16.Text="";
  2186. gui17.Text="";
  2187. gui18.Text="";
  2188. gui19.Text="";
  2189. gui21.Text="";
  2190. gui22.Text="";
  2191. gui23.Text="";
  2192. end
  2193. else
  2194. gui1.Visible=false
  2195. end
  2196. end
  2197.  
  2198.  
  2199. --The two following functions were made by weaselman50. Don't ask me how they work. :P
  2200. function check(rel, slope1, slope2, Axis)
  2201. if rel[Axis]>slope2[Axis]*-rel.z and slope1[Axis]>slope2[Axis] then
  2202. return rel[Axis]<slope1[Axis]*-rel.z
  2203. elseif slope1[Axis]<slope2[Axis] and rel[Axis]<slope2[Axis]*-rel.z then
  2204. return rel[Axis]>slope1[Axis]*-rel.z
  2205. else
  2206. return false
  2207. end
  2208. end
  2209. function search(slope1, slope2, mouse)
  2210. print("Search called");
  2211. print("Slope1: ", slope1, " - Slope2: ", slope2);
  2212. parts=HasPermission(GetParts(workspace:GetChildren()), "select");
  2213. for i, v in pairs(parts) do
  2214. local rel=(workspace.CurrentCamera.CoordinateFrame:inverse()*CFrame.new(v.Position)).p
  2215. if rel.z<0 and check(rel, slope1, slope2, "x") and check(rel, slope1, slope2, "y") then
  2216. Selection.Add(v)
  2217. end
  2218. end
  2219. end
  2220.  
  2221. function Permission(part,case)
  2222. if OnlineMode then
  2223. if #part.Name>16 and string.sub(part.Name,1,16)=="BlobbyblobBuild_" then
  2224. local owner=game.Players:findFirstChild(string.sub(part.Name,17))
  2225. if not owner then
  2226. if case~="select" or not part.Locked or (keys.check(51) or keys.check(52)) then
  2227. return true; --player left the game
  2228. end
  2229. else
  2230. local bp=owner:findFirstChild("BuildPermissions");
  2231. if bp~=nil then
  2232. if bp:findFirstChild(player.Name.."_"..case) then
  2233. if bp[player.Name.."_"..case].Value then
  2234. if case~="select" or not part.Locked or (keys.check(51) or keys.check(52)) then
  2235. return true; --player gave permission
  2236. end
  2237. end
  2238. end
  2239. end
  2240. end
  2241. elseif not part.Locked and case=="clone" then
  2242. return true --return true for cloning a starter part
  2243. end
  2244. else
  2245. --for offline build, return true for everything except selecting and dragging locked parts (without alt selected).
  2246. if case=="drag" or case=="select" then
  2247. if (keys.check(51) or keys.check(52)) or not part.Locked then
  2248. return true
  2249. else
  2250. return false
  2251. end
  2252. else
  2253. return true
  2254. end
  2255. end
  2256. return false;
  2257. end
  2258.  
  2259. function HasPermission(table_of_parts, case)
  2260. local t={};
  2261. for i,v in pairs(table_of_parts) do
  2262. if Permission(v,case) then
  2263. t[#t+1]=v;
  2264. end
  2265. end
  2266. return t;
  2267. end
  2268.  
  2269. function UserPermission(LocalUser, TargetUser, case)
  2270. local bp=TargetUser:findFirstChild("BuildPermissions");
  2271. if bp~=nil then
  2272. if bp:findFirstChild(LocalUser.Name.."_"..case) then
  2273. if bp[LocalUser.Name.."_"..case].Value then
  2274. return true; --player gave permission
  2275. end
  2276. end
  2277. end
  2278. end
  2279.  
  2280. _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"}
  2281.  
  2282. --Give all permissions to every player for themself.
  2283. if player:findFirstChild("BuildPermissions")==nil then
  2284. local m=Instance.new("Model");
  2285. m.Name="BuildPermissions";
  2286. for i,v in pairs(_possible_permissions) do
  2287. local q=Instance.new("BoolValue");
  2288. q.Name=player.Name.."_"..v;
  2289. q.Value=true;
  2290. q.Parent=m;
  2291. end
  2292. m.Parent=player;
  2293. end
  2294.  
  2295. PaletteFunctions = PaletteFunctions or {};
  2296.  
  2297. function PaletteFunctions.Reflectance()
  2298.  
  2299. function Active(p)
  2300. local c=p[1];
  2301. if c=="Unload" then
  2302. obj40.Parent=nil;
  2303. TB.remove(obj41);
  2304. FunctionData.Reflectance.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
  2305. return;
  2306. elseif c=="KeyDown" then
  2307. if string.byte(p[3])==9 then
  2308. HitButton(gui26);
  2309. Spawn(function()
  2310. local t = tab_index;
  2311. wait(Options.RepeatDelay);
  2312. while keys.check(9) and t==tab_index do
  2313. HitButton(gui26);
  2314. wait(Options.RepeatRate);
  2315. end
  2316. end);
  2317. end
  2318. Passive(p);
  2319. return;
  2320. elseif c=="KeyUp" then
  2321. if string.byte(p[3])==9 then
  2322. tab_index = tab_index + 1;
  2323. end
  2324. Passive(p);
  2325. elseif c=="Apply" then
  2326. prior={};
  2327. after={};
  2328. parts=HasPermission(GetParts(Selection.Get()), "reflectance");
  2329. FunctionData.Reflectance.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
  2330. for i,v in pairs(parts) do
  2331. prior[i]=v.Reflectance;
  2332. if FunctionData.Reflectance.Relative then
  2333. v.Reflectance=math.min(1e8, math.max(0, v.Reflectance+FunctionData.Reflectance.Value));
  2334. else
  2335. v.Reflectance=math.min(1e8, math.max(0, FunctionData.Reflectance.Value));
  2336. end
  2337. after[i]=v.Reflectance;
  2338. end
  2339. pass_action=false;
  2340. for i,v in pairs(prior) do
  2341. if prior[i]~=after[i] then
  2342. pass_action=true;
  2343. end
  2344. end
  2345. if pass_action then
  2346. History.Action("Reflectance", parts, prior, after);
  2347. end
  2348. return;
  2349. else
  2350. Passive(p);
  2351. end
  2352. end
  2353.  
  2354. tab_index=0;
  2355.  
  2356. FunctionData.Reflectance = FunctionData.Reflectance or {};
  2357. FunctionData.Reflectance.Relative = FunctionData.Reflectance.Relative or false;
  2358. FunctionData.Reflectance.Value = FunctionData.Reflectance.Value or 0.5;
  2359.  
  2360. 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)
  2361. 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
  2362. 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)
  2363. 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)
  2364.  
  2365. obj42.Text = tostring(FunctionData.Reflectance.Value);
  2366. obj40.Parent=obj1;
  2367. TB.insert(obj41, obj42);
  2368.  
  2369. function RefreshButtons()
  2370. obj43.Text = FunctionData.Reflectance.Relative and "Relative" or "Constant";
  2371. end
  2372.  
  2373. obj43.MouseButton1Down:connect(function()
  2374. FunctionData.Reflectance.Relative = not FunctionData.Reflectance.Relative;
  2375. RefreshButtons();
  2376. end)
  2377.  
  2378. RefreshButtons();
  2379.  
  2380. end
  2381.  
  2382. function PaletteFunctions.Resize()
  2383.  
  2384. function Active(p)
  2385. local c=p[1];
  2386. if c=="Button1Down" then
  2387. handles.Visible=false;
  2388. axes_x.Parent=nil;
  2389. axes_y.Parent=nil;
  2390. axes_z.Parent=nil;
  2391. Passive(p);
  2392. UpdateHandles();
  2393. elseif c=="Button1Up" then
  2394. handles.Visible=true;
  2395. axes_x.Parent=LocalBin;
  2396. axes_y.Parent=LocalBin;
  2397. axes_z.Parent=LocalBin;
  2398. HandlesUp();
  2399. Passive(p);
  2400. UpdateHandles();
  2401. elseif c=="Unload" then
  2402. obj40.Parent=nil;
  2403. TB.remove(obj41);
  2404. TB.remove(obj43);
  2405. TB.remove(obj45);
  2406. handles.Parent=nil;
  2407. axes_x.Parent=nil;
  2408. axes_y.Parent=nil;
  2409. axes_z.Parent=nil;
  2410. elseif c=="Apply" then
  2411. FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2412. FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2413. FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2414. p=HasPermission(GetParts(Selection.Get()), "resize");
  2415. pre_size={};
  2416. post_size={};
  2417. for i,v in pairs(p) do
  2418. pre_size[i]=v.Size;
  2419. local cf = v.CFrame;
  2420. v.Size = v.Size + Vector3.new(FunctionData.Resize.x, FunctionData.Resize.y, FunctionData.Resize.z);
  2421. v.CFrame = cf;
  2422. post_size[i]=v.Size;
  2423. end
  2424. History.Action("Resize", p, pre_size, post_size);
  2425. Passive(p);
  2426. UpdateHandles();
  2427. elseif c=="KeyDown" then
  2428. if string.byte(p[3])==9 then
  2429. HitButton(gui26);
  2430. Spawn(function()
  2431. local t = tab_index;
  2432. wait(Options.RepeatDelay);
  2433. while keys.check(9) and t==tab_index do
  2434. HitButton(gui26);
  2435. wait(Options.RepeatRate);
  2436. end
  2437. end);
  2438. end
  2439. Passive(p);
  2440. UpdateHandles();
  2441. else
  2442. Passive(p);
  2443. end
  2444. end
  2445.  
  2446. FunctionData.Resize=FunctionData.Resize or {};
  2447.  
  2448. FunctionData.Resize.x = FunctionData.Resize.x or 0;
  2449. FunctionData.Resize.y = FunctionData.Resize.y or 0;
  2450. FunctionData.Resize.z = FunctionData.Resize.z or 0;
  2451.  
  2452. 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)
  2453. 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
  2454. 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)
  2455. 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
  2456. 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)
  2457. 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
  2458. 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)
  2459. 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)
  2460. 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)
  2461. 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)
  2462. obj42.Text = FunctionData.Resize.x;
  2463. obj44.Text = FunctionData.Resize.y;
  2464. obj46.Text = FunctionData.Resize.z;
  2465. obj40.Parent=obj1;
  2466. TB.insert(obj41, obj42);
  2467. TB.insert(obj43, obj44);
  2468. TB.insert(obj45, obj46);
  2469. obj42.Text=FunctionData.Resize.x;
  2470. obj44.Text=FunctionData.Resize.y;
  2471. obj46.Text=FunctionData.Resize.z;
  2472.  
  2473. obj47.MouseButton1Down:connect(function()
  2474. FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2475. FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2476. FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2477. FunctionData.Resize.x = (FunctionData.Resize.x or 0) * -1;
  2478. FunctionData.Resize.y = (FunctionData.Resize.y or 0) * -1;
  2479. FunctionData.Resize.z = (FunctionData.Resize.z or 0) * -1;
  2480. obj42.Text = FunctionData.Resize.x;
  2481. obj44.Text = FunctionData.Resize.y;
  2482. obj46.Text = FunctionData.Resize.z;
  2483. end)
  2484. obj48.MouseButton1Down:connect(function()
  2485. FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2486. FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2487. FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2488. FunctionData.Resize.x = (FunctionData.Resize.x or 0) * 2;
  2489. FunctionData.Resize.y = (FunctionData.Resize.y or 0) * 2;
  2490. FunctionData.Resize.z = (FunctionData.Resize.z or 0) * 2;
  2491. obj42.Text = FunctionData.Resize.x;
  2492. obj44.Text = FunctionData.Resize.y;
  2493. obj46.Text = FunctionData.Resize.z;
  2494. end)
  2495. obj49.MouseButton1Down:connect(function()
  2496. FunctionData.Resize.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2497. FunctionData.Resize.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2498. FunctionData.Resize.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2499. FunctionData.Resize.x = (FunctionData.Resize.x or 0) * .5;
  2500. FunctionData.Resize.y = (FunctionData.Resize.y or 0) * .5;
  2501. FunctionData.Resize.z = (FunctionData.Resize.z or 0) * .5;
  2502. obj42.Text = FunctionData.Resize.x;
  2503. obj44.Text = FunctionData.Resize.y;
  2504. obj46.Text = FunctionData.Resize.z;
  2505. end)
  2506.  
  2507. axes_x=Instance.new("Part");
  2508. axes_x.Anchored=true;
  2509. axes_x.CanCollide=false;
  2510. axes_x.Transparency=1;
  2511. Instance.new("CylinderMesh").Parent=axes_x;
  2512. axes_x.Name="axes_x";
  2513. axes_x.formFactor=0;
  2514. axes_x.Size=Vector3.new(1, 3, 1);
  2515. axes_x.BrickColor=BrickColor.new("Bright yellow");
  2516. axes_x.Parent=LocalBin;
  2517.  
  2518. axes_y=Instance.new("Part");
  2519. axes_y.Anchored=true;
  2520. axes_y.CanCollide=false;
  2521. axes_y.Transparency=1;
  2522. Instance.new("CylinderMesh").Parent=axes_y;
  2523. axes_y.Name="axes_y";
  2524. axes_y.formFactor=0;
  2525. axes_y.Size=Vector3.new(1, 3, 1);
  2526. axes_y.BrickColor=BrickColor.new("Cyan");
  2527. axes_y.Parent=LocalBin;
  2528.  
  2529. axes_z=Instance.new("Part");
  2530. axes_z.Anchored=true;
  2531. axes_z.CanCollide=false;
  2532. axes_z.Transparency=1;
  2533. Instance.new("CylinderMesh").Parent=axes_z;
  2534. axes_z.Name="axes_z";
  2535. axes_z.formFactor=0;
  2536. axes_z.Size=Vector3.new(1, 3, 1);
  2537. axes_z.BrickColor=BrickColor.new("Magenta");
  2538. axes_z.Parent=LocalBin;
  2539.  
  2540. handles=Instance.new("Handles");
  2541. handles.Color=Options.ResizeHandlesColor;
  2542. handles.Parent=obj1;
  2543.  
  2544. function HandlesUp()
  2545. if resize_drag~=nil then
  2546. History.Action("Move+Resize", resize_drag, original_location, resize_drag.CFrame, original_size, resize_drag.Size);
  2547. original_locations={};
  2548. UpdateHandles();
  2549. end
  2550. end;
  2551.  
  2552. resize_drag=nil;
  2553. old_distance=0;
  2554. original_location=CFrame.new();
  2555. original_size=CFrame.new();
  2556. handles.MouseButton1Down:connect(function()
  2557. p=HasPermission(GetParts(Selection.Get()), "handles_resize");
  2558. if #p==1 then
  2559. resize_drag=p[1];
  2560. original_location=resize_drag.CFrame;
  2561. original_size=resize_drag.Size;
  2562. old_distance = 0;
  2563. end
  2564. end)
  2565. handles.MouseButton1Up:connect(HandlesUp)
  2566. handles.MouseDrag:connect(function(face, dist)
  2567. new_distance = round(dist - old_distance, Options.ResizeDragIntervals);
  2568. old_distance = old_distance + new_distance;
  2569. if new_distance~=0 then
  2570. local faces=Vector3.new();
  2571. if face==Enum.NormalId.Left then
  2572. faces=Vector3.new(-1, 0, 0); -- -
  2573. elseif face==Enum.NormalId.Right then
  2574. faces=Vector3.new(1, 0, 0); -- +
  2575. elseif face==Enum.NormalId.Top then
  2576. faces=Vector3.new(0, 1, 0); -- +
  2577. elseif face==Enum.NormalId.Bottom then
  2578. faces=Vector3.new(0, -1, 0); -- -
  2579. elseif face==Enum.NormalId.Front then
  2580. faces=Vector3.new(0, 0, -1); -- -
  2581. elseif face==Enum.NormalId.Back then
  2582. faces=Vector3.new(0, 0, 1); -- +
  2583. end
  2584. if math.abs(faces.x)==1 then
  2585. new_distance=math.max(-resize_drag.Size.x+Options.SmallestSize.x, new_distance);
  2586. elseif math.abs(faces.y)==1 then
  2587. new_distance=math.max(-resize_drag.Size.y+Options.SmallestSize.y, new_distance);
  2588. elseif math.abs(faces.z)==1 then
  2589. new_distance=math.max(-resize_drag.Size.z+Options.SmallestSize.z, new_distance);
  2590. end
  2591. cf=resize_drag.CFrame;
  2592. resize_drag.Size = resize_drag.Size + Vector3.new(math.abs(faces.x), math.abs(faces.y), math.abs(faces.z)) * new_distance;
  2593. resize_drag.CFrame=cf * CFrame.new(faces * new_distance / 2);
  2594. UpdateHandles();
  2595. end
  2596. end)
  2597.  
  2598. function UpdateHandles()
  2599. p=HasPermission(GetParts(Selection.Get()), "handles_resize");
  2600. if #p==1 then
  2601. handles.Adornee=p[1];
  2602. if Options.ThreeAxes then
  2603. axes_x.Transparency=0;
  2604. axes_y.Transparency=0;
  2605. axes_z.Transparency=0;
  2606. 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);
  2607. axes_y.CFrame=p[1].CFrame*CFrame.new(0, p[1].Size.y/2+axes_y.Size.y/2,0);
  2608. 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);
  2609. end
  2610. else
  2611. handles.Adornee=nil;
  2612. axes_x.Transparency=1;
  2613. axes_y.Transparency=1;
  2614. axes_z.Transparency=1;
  2615. end
  2616. end
  2617.  
  2618. round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
  2619.  
  2620. UpdateHandles();
  2621.  
  2622. end
  2623.  
  2624. PaletteFunctions = PaletteFunctions or {};
  2625.  
  2626. function PaletteFunctions.RotVelocity()
  2627.  
  2628. function Active(p) --p accepts a table of parameters.
  2629. local c=p[1]; --c is command.
  2630. if c=="Unload" then
  2631. FunctionData.RotVelocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2632. FunctionData.RotVelocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2633. FunctionData.RotVelocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2634. obj40.Parent=nil;
  2635. TB.remove(obj41);
  2636. TB.remove(obj43);
  2637. TB.remove(obj45);
  2638. return;
  2639. elseif c=="KeyDown" then
  2640. if string.byte(p[3])==9 then
  2641. HitButton(gui26);
  2642. end
  2643. Passive(p);
  2644. return;
  2645. elseif c=="Apply" then
  2646. FunctionData.RotVelocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2647. FunctionData.RotVelocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2648. FunctionData.RotVelocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2649. print(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z);
  2650. local prior={};
  2651. parts=HasPermission(GetParts(Selection.Get()), "rotvelocity");
  2652. for i,v in pairs(parts) do
  2653. prior[i]=v.RotVelocity;
  2654. v.RotVelocity=Vector3.new(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z);
  2655. end
  2656. History.Action("RotVelocity", parts, prior, Vector3.new(FunctionData.RotVelocity.x, FunctionData.RotVelocity.y, FunctionData.RotVelocity.z));
  2657. return;
  2658. else
  2659. Passive(p);
  2660. end
  2661. end
  2662.  
  2663. FunctionData.RotVelocity = FunctionData.RotVelocity or {};
  2664. FunctionData.RotVelocity.x = FunctionData.RotVelocity.x or 0;
  2665. FunctionData.RotVelocity.y = FunctionData.RotVelocity.y or 0;
  2666. FunctionData.RotVelocity.z = FunctionData.RotVelocity.z or 0;
  2667.  
  2668.  
  2669. 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);
  2670. 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;
  2671. 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);
  2672. 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;
  2673. 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);
  2674. 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;
  2675. 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);
  2676. obj42.Text=FunctionData.RotVelocity.x;
  2677. obj44.Text=FunctionData.RotVelocity.y;
  2678. obj46.Text=FunctionData.RotVelocity.z;
  2679. obj40.Parent=obj1;
  2680.  
  2681. TB.insert(obj41, obj42);
  2682. TB.insert(obj43, obj44);
  2683. TB.insert(obj45, obj46);
  2684.  
  2685. end
  2686.  
  2687. function PaletteFunctions.Rotate()
  2688.  
  2689. tab_index = 0;
  2690. function Active(p)
  2691. local c=p[1];
  2692. if c=="Button1Down" then
  2693. if pending_selection then
  2694. FunctionData.Rotate.Around = p[2].Target;
  2695. pending_selection = false;
  2696. sb.Visible=false;
  2697. HandlesUp();
  2698. UpdateButtons();
  2699. UpdateHandles();
  2700. else
  2701. axes_x.Parent=nil;
  2702. axes_y.Parent=nil;
  2703. axes_z.Parent=nil;
  2704. aabb.Parent=nil;
  2705. handles.Visible=false;
  2706. Passive(p);
  2707. UpdateHandles();
  2708. end
  2709. elseif c=="Button1Up" then
  2710. HandlesUp();
  2711. axes_x.Parent=LocalBin;
  2712. axes_y.Parent=LocalBin;
  2713. axes_z.Parent=LocalBin;
  2714. aabb.Parent=LocalBin;
  2715. Passive(p);
  2716. UpdateHandles();
  2717. elseif c=="Unload" then
  2718. FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2719. FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2720. FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2721. obj40.Parent=nil;
  2722. handles.Parent=nil;
  2723. sb.Parent=nil;
  2724. axes_x.Parent=nil;
  2725. axes_y.Parent=nil;
  2726. axes_z.Parent=nil;
  2727. aabb.Parent=nil;
  2728. Passive(p);
  2729. elseif c=="Apply" then
  2730. FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2731. FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2732. FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2733. if FunctionData.Rotate.x~=0 or FunctionData.Rotate.y~=0 or FunctionData.Rotate.z~=0 then
  2734. p=HasPermission(GetParts(Selection.Get()), "rotate");
  2735. old_cframe={}; for i,v in pairs(p) do old_cframe[#old_cframe+1]=v.CFrame; end
  2736. if FunctionData.Rotate.Around and FunctionData.Rotate.WorldAxis then
  2737.  
  2738. center=CFrame.new(FunctionData.Rotate.Around.Position);
  2739. origin={};
  2740. for i,v in pairs(p) do
  2741. origin[v]=center:toObjectSpace(v.CFrame)
  2742. end
  2743. center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z))
  2744. for i,v in pairs(origin) do
  2745. i.CFrame=center:toWorldSpace(v)
  2746. end
  2747.  
  2748. elseif FunctionData.Rotate.Around and not FunctionData.Rotate.WorldAxis then
  2749.  
  2750. center=FunctionData.Rotate.Around.CFrame;
  2751. origin={};
  2752. for i,v in pairs(p) do
  2753. origin[v]=center:toObjectSpace(v.CFrame)
  2754. end
  2755. center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
  2756. for i,v in pairs(origin) do
  2757. i.CFrame=center:toWorldSpace(v)
  2758. end
  2759.  
  2760. elseif FunctionData.Rotate.AsWhole then
  2761.  
  2762. center = Vector3.new();
  2763. for i,v in pairs(p) do
  2764. center = center + v.Position;
  2765. end
  2766. center = CFrame.new(center / #p);
  2767. origin={};
  2768. for i,v in pairs(p) do
  2769. origin[v]=center:toObjectSpace(v.CFrame)
  2770. end
  2771. center=center*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
  2772. for i,v in pairs(origin) do
  2773. i.CFrame=center:toWorldSpace(v)
  2774. end
  2775.  
  2776. elseif FunctionData.Rotate.Constant then
  2777.  
  2778. for i,v in pairs(p) do
  2779. v.CFrame = CFrame.new(v.CFrame.p)*CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
  2780. end
  2781.  
  2782. elseif FunctionData.Rotate.WorldAxis then
  2783.  
  2784. for i,v in pairs(p) do
  2785. 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);
  2786. end
  2787.  
  2788. else
  2789.  
  2790. for i,v in pairs(p) do
  2791. v.CFrame = v.CFrame * CFrame.Angles(math.rad(FunctionData.Rotate.x), math.rad(FunctionData.Rotate.y), math.rad(FunctionData.Rotate.z));
  2792. end
  2793.  
  2794. end
  2795. new_cframe={}; for i,v in pairs(p) do new_cframe[#new_cframe+1]=v.CFrame; end
  2796. History.Action("Rotate", p, old_cframe, new_cframe);
  2797. end
  2798. Passive(p);
  2799. UpdateHandles();
  2800. elseif c=="Move" then
  2801. if pending_selection then
  2802. sb.Adornee = p[2].Target;
  2803. end
  2804. Passive(p);
  2805. elseif c=="KeyDown" then
  2806. if string.byte(p[3])==9 then
  2807. HitButton(gui26);
  2808. Spawn(function()
  2809. local t = tab_index;
  2810. wait(Options.RepeatDelay);
  2811. while keys.check(9) and t==tab_index do
  2812. HitButton(gui26);
  2813. wait(Options.RepeatRate);
  2814. end
  2815. end);
  2816. tab_index = tab_index + 1;
  2817. end
  2818. Passive(p);
  2819. UpdateHandles();
  2820. else
  2821. Passive(p);
  2822. end
  2823. end
  2824.  
  2825. FunctionData.Rotate=FunctionData.Rotate or {};
  2826.  
  2827. FunctionData.Rotate.x = FunctionData.Rotate.x or 0;
  2828. FunctionData.Rotate.y = FunctionData.Rotate.y or 0;
  2829. FunctionData.Rotate.z = FunctionData.Rotate.z or 0;
  2830. if FunctionData.Rotate.WorldAxis==nil then
  2831. FunctionData.Rotate.WorldAxis = false;
  2832. end
  2833. if FunctionData.Rotate.AsWhole==nil then
  2834. FunctionData.Rotate.AsWhole = true;
  2835. end
  2836. if FunctionData.Rotate.Constant==nil then
  2837. FunctionData.Rotate.Constant = false;
  2838. end
  2839. FunctionData.Rotate.Around = FunctionData.Rotate.Around;
  2840.  
  2841. 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)
  2842. 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
  2843. 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)
  2844. 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
  2845. 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)
  2846. 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
  2847. 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)
  2848. 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)
  2849. 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)
  2850. 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)
  2851. 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)
  2852. 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)
  2853. 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)
  2854. 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)
  2855. obj40.Parent=obj1;
  2856. TB.insert(obj41, obj42);
  2857. TB.insert(obj43, obj44);
  2858. TB.insert(obj45, obj46);
  2859. obj42.Text=FunctionData.Rotate.x;
  2860. obj44.Text=FunctionData.Rotate.y;
  2861. obj46.Text=FunctionData.Rotate.z;
  2862.  
  2863. function UpdateButtons()
  2864. if FunctionData.Rotate.Around~=nil then
  2865. obj47.BackgroundColor3=Options.ButtonColor;
  2866. obj51.BackgroundColor3=Options.InactiveColor;
  2867. obj52.BackgroundColor3=Options.InactiveColor;
  2868. obj53.BackgroundColor3=Options.ButtonColor;
  2869. obj47.Text = FunctionData.Rotate.WorldAxis and "World Axis" or "Centroid Axis";
  2870. obj51.Text = "As Whole";
  2871. obj52.Text = "Relative";
  2872. obj53.Text = "Around Part";
  2873. elseif FunctionData.Rotate.AsWhole then
  2874. obj47.BackgroundColor3=Options.InactiveColor;
  2875. obj51.BackgroundColor3=Options.ButtonColor;
  2876. obj52.BackgroundColor3=Options.InactiveColor;
  2877. obj53.BackgroundColor3=Options.ButtonColor;
  2878. obj47.Text = "World Axis";
  2879. obj51.Text = "As Whole";
  2880. obj52.Text = "Relative";
  2881. obj53.Text = "Around nil";
  2882. elseif FunctionData.Rotate.Constant then
  2883. obj47.BackgroundColor3=Options.InactiveColor;
  2884. obj51.BackgroundColor3=Options.InactiveColor;
  2885. obj52.BackgroundColor3=Options.ButtonColor;
  2886. obj53.BackgroundColor3=Options.InactiveColor;
  2887. obj47.Text = "World Axis";
  2888. obj51.Text = "Individually";
  2889. obj52.Text = "Constant";
  2890. obj53.Text = "Around nil";
  2891. else
  2892. obj47.BackgroundColor3=Options.ButtonColor;
  2893. obj51.BackgroundColor3=Options.ButtonColor;
  2894. obj52.BackgroundColor3=Options.ButtonColor;
  2895. obj53.BackgroundColor3=Options.ButtonColor;
  2896. obj47.Text = FunctionData.Rotate.WorldAxis and "World Axis" or "Object's Axis";
  2897. obj51.Text = "Individually";
  2898. obj52.Text = "Relative";
  2899. obj53.Text = "Around nil";
  2900. end
  2901. end
  2902.  
  2903. UpdateButtons();
  2904.  
  2905. obj47.MouseButton1Down:connect(function()
  2906. FunctionData.Rotate.WorldAxis = not FunctionData.Rotate.WorldAxis;
  2907. UpdateButtons();
  2908. UpdateHandles();
  2909. end)
  2910. obj51.MouseButton1Down:connect(function()
  2911. FunctionData.Rotate.AsWhole = not FunctionData.Rotate.AsWhole;
  2912. UpdateButtons();
  2913. UpdateHandles();
  2914. end)
  2915. obj52.MouseButton1Down:connect(function()
  2916. FunctionData.Rotate.Constant = not FunctionData.Rotate.Constant;
  2917. UpdateButtons();
  2918. UpdateHandles();
  2919. end)
  2920. pending_selection = false;
  2921. sb=Instance.new("SelectionBox");
  2922. sb.Color=Options.ActiveSelectionBoxColor;
  2923. sb.Name="PendingDistinguisher";
  2924. sb.Visible=false;
  2925. sb.Parent=obj1;
  2926. obj53.MouseButton1Down:connect(function()
  2927. if not pending_selection then
  2928. pending_selection = true;
  2929. sb.Visible=true;
  2930. else
  2931. pending_selection = false;
  2932. sb.Visible=false;
  2933. FunctionData.Rotate.Around = nil;
  2934. end
  2935. UpdateButtons();
  2936. end)
  2937.  
  2938. obj48.MouseButton1Down:connect(function()
  2939. FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2940. FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2941. FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2942. FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * -1;
  2943. FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * -1;
  2944. FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * -1;
  2945. obj42.Text = FunctionData.Rotate.x;
  2946. obj44.Text = FunctionData.Rotate.y;
  2947. obj46.Text = FunctionData.Rotate.z;
  2948. end)
  2949. obj49.MouseButton1Down:connect(function()
  2950. FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2951. FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2952. FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2953. FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * 2;
  2954. FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * 2;
  2955. FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * 2;
  2956. obj42.Text = FunctionData.Rotate.x;
  2957. obj44.Text = FunctionData.Rotate.y;
  2958. obj46.Text = FunctionData.Rotate.z;
  2959. end)
  2960. obj50.MouseButton1Down:connect(function()
  2961. FunctionData.Rotate.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  2962. FunctionData.Rotate.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  2963. FunctionData.Rotate.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  2964. FunctionData.Rotate.x = (FunctionData.Rotate.x or 0) * .5;
  2965. FunctionData.Rotate.y = (FunctionData.Rotate.y or 0) * .5;
  2966. FunctionData.Rotate.z = (FunctionData.Rotate.z or 0) * .5;
  2967. obj42.Text = FunctionData.Rotate.x;
  2968. obj44.Text = FunctionData.Rotate.y;
  2969. obj46.Text = FunctionData.Rotate.z;
  2970. end)
  2971.  
  2972. axes_x=Instance.new("Part");
  2973. axes_x.Anchored=true;
  2974. axes_x.CanCollide=false;
  2975. axes_x.Transparency=1;
  2976. Instance.new("CylinderMesh").Parent=axes_x;
  2977. axes_x.Name="axes_x";
  2978. axes_x.formFactor=0;
  2979. axes_x.Size=Vector3.new(1, 3, 1);
  2980. axes_x.BrickColor=BrickColor.new("Bright yellow");
  2981. axes_x.Parent=LocalBin;
  2982.  
  2983. axes_y=Instance.new("Part");
  2984. axes_y.Anchored=true;
  2985. axes_y.CanCollide=false;
  2986. axes_y.Transparency=1;
  2987. Instance.new("CylinderMesh").Parent=axes_y;
  2988. axes_y.Name="axes_x";
  2989. axes_y.formFactor=0;
  2990. axes_y.Size=Vector3.new(1, 3, 1);
  2991. axes_y.BrickColor=BrickColor.new("Cyan");
  2992. axes_y.Parent=LocalBin;
  2993.  
  2994. axes_z=Instance.new("Part");
  2995. axes_z.Anchored=true;
  2996. axes_z.CanCollide=false;
  2997. axes_z.Transparency=1;
  2998. Instance.new("CylinderMesh").Parent=axes_z;
  2999. axes_z.Name="axes_x";
  3000. axes_z.formFactor=0;
  3001. axes_z.Size=Vector3.new(1, 3, 1);
  3002. axes_z.BrickColor=BrickColor.new("Magenta");
  3003. axes_z.Parent=LocalBin;
  3004.  
  3005. aabb=Instance.new("Part");
  3006. aabb.Anchored=true;
  3007. aabb.CanCollide=false;
  3008. aabb.Transparency=1;
  3009. aabb.Parent=LocalBin;
  3010. handles=Instance.new("ArcHandles");
  3011. handles.Color=Options.RotateHandlesColor;
  3012. handles.Adornee=aabb;
  3013. handles.Parent=obj1;
  3014.  
  3015. function HandlesUp()
  3016. if #rotate_drag>0 then
  3017. new_cframe={};
  3018. for i,v in pairs(rotate_drag) do
  3019. new_cframe[#new_cframe+1]=v.CFrame;
  3020. end
  3021. History.Action("Rotate", rotate_drag, original_cframe, new_cframe);
  3022. rotate_drag={};
  3023. end
  3024. end;
  3025.  
  3026. old_rotation=0;
  3027. rotate_drag={};
  3028. original_cframe={};
  3029. rotate_by=Vector3.new(0,0,0);
  3030. handles.MouseButton1Down:connect(function(axis)
  3031. if axis==Enum.Axis.X then
  3032. rotate_by=Vector3.new(1,0,0);
  3033. elseif axis==Enum.Axis.Y then
  3034. rotate_by=Vector3.new(0,1,0);
  3035. elseif axis==Enum.Axis.Z then
  3036. rotate_by=Vector3.new(0,0,1);
  3037. end
  3038. rotate_drag=HasPermission(GetParts(Selection.Get()), "handles_rotate");
  3039. old_rotation=0;
  3040. original_cframe={};
  3041. for i,v in pairs(rotate_drag) do
  3042. original_cframe[i]=v.CFrame;
  3043. end
  3044. end)
  3045. handles.MouseButton1Up:connect(HandlesUp)
  3046. handles.MouseDrag:connect(function(face, dist)
  3047. if #rotate_drag>0 then
  3048. new_dist = round(dist - old_rotation, math.rad(Options.RotateDragIntervals));
  3049. if new_dist~=0 then
  3050. if FunctionData.Rotate.Around~=nil and FunctionData.Rotate.WorldAxis then
  3051. center=CFrame.new(FunctionData.Rotate.Around.Position);
  3052. origin={};
  3053. for i,v in pairs(rotate_drag) do
  3054. origin[v]=center:toObjectSpace(v.CFrame)
  3055. end
  3056. center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
  3057. for i,v in pairs(origin) do
  3058. i.CFrame=center:toWorldSpace(v)
  3059. end
  3060. elseif FunctionData.Rotate.Around~=nil and not FunctionData.Rotate.WorldAxis then
  3061. center=FunctionData.Rotate.Around.CFrame;
  3062. origin={};
  3063. for i,v in pairs(rotate_drag) do
  3064. origin[v]=center:toObjectSpace(v.CFrame)
  3065. end
  3066. center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
  3067. for i,v in pairs(origin) do
  3068. i.CFrame=center:toWorldSpace(v)
  3069. end
  3070. else
  3071. center = Vector3.new();
  3072. for i,v in pairs(rotate_drag) do
  3073. center = center + v.Position;
  3074. end
  3075. center = CFrame.new(center / #rotate_drag);
  3076. origin={};
  3077. for i,v in pairs(rotate_drag) do
  3078. origin[v]=center:toObjectSpace(v.CFrame)
  3079. end
  3080. center=center*CFrame.Angles(rotate_by.x*new_dist, rotate_by.y*new_dist, rotate_by.z*new_dist)
  3081. for i,v in pairs(origin) do
  3082. i.CFrame=center:toWorldSpace(v)
  3083. end
  3084. end
  3085. end
  3086. old_rotation = old_rotation + new_dist;
  3087. end
  3088. end)
  3089.  
  3090. function UpdateHandles()
  3091. parts=HasPermission(GetParts(Selection.Get()), "handles_rotate");
  3092. if #parts>0 then
  3093. if FunctionData.Rotate.Around~=nil and FunctionData.Rotate.WorldAxis then
  3094. center=FunctionData.Rotate.Around.CFrame.p;
  3095. max=0;
  3096. for i,v in pairs(parts) do
  3097. for x=-1,1,2 do
  3098. for y=-1,1,2 do
  3099. for z=-1,1,2 do
  3100. local s=v.Size/2;
  3101. local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
  3102. max=math.max(max, (p - center).magnitude);
  3103. end
  3104. end
  3105. end
  3106. end
  3107. aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
  3108. aabb.CFrame = CFrame.new(center);
  3109. if aabb.Parent then handles.Visible=true; end
  3110. elseif FunctionData.Rotate.Around~=nil and not FunctionData.Rotate.WorldAxis then
  3111. center=FunctionData.Rotate.Around.CFrame.p;
  3112. max=0;
  3113. for i,v in pairs(parts) do
  3114. for x=-1,1,2 do
  3115. for y=-1,1,2 do
  3116. for z=-1,1,2 do
  3117. local s=v.Size/2;
  3118. local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
  3119. max=math.max(max, (p - center).magnitude);
  3120. end
  3121. end
  3122. end
  3123. end
  3124. aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
  3125. aabb.CFrame = FunctionData.Rotate.Around.CFrame;
  3126. if aabb.Parent then handles.Visible=true; end
  3127. else
  3128. center = Vector3.new();
  3129. for i,v in pairs(parts) do
  3130. center = center + v.Position;
  3131. end
  3132. center = center / #parts;
  3133. max=0;
  3134. for i,v in pairs(parts) do
  3135. for x=-1,1,2 do
  3136. for y=-1,1,2 do
  3137. for z=-1,1,2 do
  3138. local s=v.Size/2;
  3139. local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
  3140. max=math.max(max, (p - center).magnitude);
  3141. end
  3142. end
  3143. end
  3144. end
  3145. aabb.Size=Vector3.new(max / 0.866025404, max / 0.866025404, max / 0.866025404);
  3146. aabb.CFrame = CFrame.new(center);
  3147. if aabb.Parent then handles.Visible=true; end
  3148. end
  3149. else
  3150. handles.Visible=false;
  3151. end
  3152. end
  3153.  
  3154. round=function(number,multiple) return math.floor(number/multiple+.5)*multiple; end;
  3155.  
  3156. UpdateHandles();
  3157.  
  3158. end
  3159.  
  3160. --[[ Selection
  3161.  
  3162. void Selection.Add(p as Part)
  3163. void Selection.Remove(p as Part)
  3164. bool Selection.Check(p as Part)
  3165. void Selection.Clear()
  3166. table Selection.Get() --returns all selected parts
  3167.  
  3168. ]]
  3169.  
  3170. function getAABB(parts)
  3171. if type(parts)~="table" then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
  3172. if #parts==0 then return Vector3.new(0,0,0), Vector3.new(0,0,0) end
  3173. local min=parts[1].Position
  3174. local max=parts[1].Position
  3175. for i,v in pairs(parts) do
  3176. for x=-1,1,2 do
  3177. for y=-1,1,2 do
  3178. for z=-1,1,2 do
  3179. local s=v.Size/2;
  3180. local p = ((v.CFrame-v.CFrame.p) * CFrame.new(x*s.x, y*s.y, z*s.z)).p + v.Position;
  3181. min=Vector3.new(math.min(p.x,min.x),math.min(p.y,min.y),math.min(p.z,min.z));
  3182. max=Vector3.new(math.max(p.x,max.x),math.max(p.y,max.y),math.max(p.z,max.z));
  3183. end
  3184. end
  3185. end
  3186. end
  3187. return min,max
  3188. end
  3189.  
  3190. function DistanceAlongLine(lineStart, lineDirection, point)
  3191. return ((point - lineStart):Dot(lineDirection)) / (lineDirection:Dot(lineDirection)) --(lineStart + distanceAlongLine * lineDirection)
  3192. end
  3193.  
  3194. Selx={part, box, bb};
  3195. Selx.Remove=function(self)
  3196. if self.box~=nil then
  3197. self.box.Parent=nil;
  3198. end
  3199. if self.bb~=nil then
  3200. self.bb.Parent=nil;
  3201. end
  3202. end;
  3203. Selx.new=function()
  3204. local o={};
  3205. setmetatable(o, {__index = Selx});
  3206. return o;
  3207. end;
  3208.  
  3209. Selection={Parts={},};
  3210. Selection.Add=function(p)
  3211. for i,v in pairs(Selection.Parts) do
  3212. if v.part==p or v.part:IsAncestorOf(p) then
  3213. return nil;
  3214. end
  3215. end
  3216. for i=#Selection.Parts, 1, -1 do
  3217. if Selection.Parts[i].part:IsDescendantOf(p) then
  3218. Selection.Parts[i]:Remove();
  3219. table.remove(Selection.Parts, i);
  3220. end
  3221. end
  3222. e=Selx.new();
  3223. e.part = p;
  3224. e.box = Instance.new("SelectionBox");
  3225. e.box.Adornee = p;
  3226. e.box.Color = Options.BoundingBoxColor;
  3227. e.box.Parent = gui;
  3228. Selection.Parts[#Selection.Parts+1] = e;
  3229. end;
  3230. Selection.Remove=function(p)
  3231. done = false;
  3232. while not done do
  3233. done = true;
  3234. for i = #Selection.Parts, 1, -1 do
  3235. if Selection.Parts[i].part==p then
  3236. Selection.Parts[i]:Remove();
  3237. table.remove(Selection.Parts, i);
  3238. done=true;
  3239. i = 0;
  3240. elseif Selection.Parts[i].part:IsAncestorOf(p) then
  3241. for a,v in pairs(Selection.Parts[i].part:GetChildren()) do
  3242. e=Selx.new();
  3243. e.part = v;
  3244. e.box = Instance.new("SelectionBox");
  3245. e.box.Adornee = v;
  3246. e.box.Color = Options.BoundingBoxColor;
  3247. e.box.Parent = gui;
  3248. Selection.Parts[#Selection.Parts+1] = e;
  3249. end
  3250. done=false;
  3251. Selection.Parts[i]:Remove();
  3252. table.remove(Selection.Parts, i);
  3253. elseif Selection.Parts[i].part:IsDescendantOf(p) then
  3254. Selection.Parts[i]:Remove();
  3255. table.remove(Selection.Parts, i);
  3256. end
  3257. end
  3258. end
  3259. end;
  3260. Selection.Check=function(p)
  3261. for i,v in pairs(Selection.Parts) do
  3262. if v.part==p or v.part:IsAncestorOf(p) then
  3263. return true;
  3264. end
  3265. end
  3266. end;
  3267. Selection.Get=function()
  3268. parts={};
  3269. for i,v in pairs(Selection.Parts) do
  3270. parts[#parts+1]=v.part;
  3271. end
  3272. return parts;
  3273. end;
  3274. Selection.Clear=function()
  3275. for i,v in pairs(Selection.Parts) do
  3276. v:Remove();
  3277. end
  3278. Selection.Parts={};
  3279. end
  3280.  
  3281. PaletteFunctions = PaletteFunctions or {};
  3282.  
  3283. function PaletteFunctions.Shape()
  3284.  
  3285. function Active(p) --p accepts a table of parameters.
  3286. local c=p[1]; --c is command.
  3287. if c=="Unload" then
  3288. obj40.Parent=nil;
  3289. return;
  3290. elseif c=="KeyDown" then
  3291. if string.byte(p[3])==9 then
  3292. HitButton(gui26);
  3293. end
  3294. Passive(p);
  3295. return;
  3296. elseif c=="Apply" then
  3297. prior={};
  3298. after={};
  3299. parts=HasPermission(GetParts(Selection.Get()), "shape");
  3300. made_change=false;
  3301. for i,v in pairs(parts) do
  3302. if v.className=="Part" then
  3303. prior[i]={v, v.CFrame, v.Size, v.Shape};
  3304. else
  3305. prior[i]={v, v.CFrame, v.Size};
  3306. end
  3307. if FunctionData.Shape.Mode=="Brick" and v.className~="Part" then
  3308. local par=v.Parent;
  3309. v.Parent=nil;
  3310. Selection.Remove(v);
  3311. local new=Instance.new("Part");
  3312. new.Shape=Enum.PartType.Block;
  3313. if v:IsA("BasePart") and not v:IsA("TrussPart") then
  3314. new.FormFactor=v.FormFactor;
  3315. else
  3316. new.FormFactor=Enum.FormFactor.Custom;
  3317. end
  3318. new.Size=v.Size;
  3319. new.CFrame=v.CFrame;
  3320. new.BrickColor=v.BrickColor;
  3321. new.Material=v.Material;
  3322. new.Reflectance=v.Reflectance;
  3323. new.Transparency=v.Transparency;
  3324. new.Name=v.Name;
  3325. new.RotVelocity=v.RotVelocity;
  3326. new.Velocity=v.Velocity;
  3327. new.Anchored=v.Anchored;
  3328. new.CanCollide=v.CanCollide;
  3329. new.Locked=v.Locked;
  3330. new.Elasticity=v.Elasticity;
  3331. new.Friction=v.Friction;
  3332. new.BackSurface=v.BackSurface
  3333. new.BottomSurface=v.BottomSurface
  3334. new.FrontSurface=v.FrontSurface
  3335. new.LeftSurface=v.LeftSurface
  3336. new.RightSurface=v.RightSurface
  3337. new.TopSurface=v.TopSurface
  3338. for _,a in pairs(v:GetChildren()) do
  3339. a:clone().Parent=new;
  3340. end
  3341. new.Parent=par;
  3342. after[i]={new};
  3343. Selection.Add(new);
  3344. made_change=true;
  3345. elseif FunctionData.Shape.Mode=="Brick" and v.className=="Part" and v.Shape~=Enum.PartType.Block then
  3346. local cf=v.CFrame;
  3347. v.Shape=Enum.PartType.Block;
  3348. v.CFrame=cf;
  3349. after[i]={nil, Enum.PartType.Block};
  3350. made_change=true;
  3351. elseif FunctionData.Shape.Mode=="Wedge" and v.className~="WedgePart" then
  3352. local par=v.Parent;
  3353. v.Parent=nil;
  3354. Selection.Remove(v);
  3355. local new=Instance.new("WedgePart");
  3356. if v:IsA("BasePart") and not v:IsA("TrussPart") then
  3357. new.FormFactor=v.FormFactor;
  3358. else
  3359. new.FormFactor=Enum.FormFactor.Custom;
  3360. end
  3361. new.Size=v.Size;
  3362. new.CFrame=v.CFrame;
  3363. new.BrickColor=v.BrickColor;
  3364. new.Material=v.Material;
  3365. new.Reflectance=v.Reflectance;
  3366. new.Transparency=v.Transparency;
  3367. new.Name=v.Name;
  3368. new.RotVelocity=v.RotVelocity;
  3369. new.Velocity=v.Velocity;
  3370. new.Anchored=v.Anchored;
  3371. new.CanCollide=v.CanCollide;
  3372. new.Locked=v.Locked;
  3373. new.Elasticity=v.Elasticity;
  3374. new.Friction=v.Friction;
  3375. new.BackSurface=v.BackSurface
  3376. new.BottomSurface=v.BottomSurface
  3377. new.FrontSurface=v.FrontSurface
  3378. new.LeftSurface=v.LeftSurface
  3379. new.RightSurface=v.RightSurface
  3380. new.TopSurface=v.TopSurface
  3381. for _,a in pairs(v:GetChildren()) do
  3382. a:clone().Parent=new;
  3383. end
  3384. new.Parent=par;
  3385. after[i]={new};
  3386. Selection.Add(new);
  3387. made_change=true;
  3388. elseif FunctionData.Shape.Mode=="Sphere" and v.className~="Part" then
  3389. local par=v.Parent;
  3390. v.Parent=nil;
  3391. Selection.Remove(v);
  3392. local new=Instance.new("Part");
  3393. new.Shape=Enum.PartType.Ball;
  3394. if v:IsA("BasePart") and not v:IsA("TrussPart") then
  3395. new.FormFactor=v.FormFactor;
  3396. else
  3397. new.FormFactor=Enum.FormFactor.Custom;
  3398. end
  3399. new.Size=v.Size;
  3400. new.CFrame=v.CFrame;
  3401. new.BrickColor=v.BrickColor;
  3402. new.Material=v.Material;
  3403. new.Reflectance=v.Reflectance;
  3404. new.Transparency=v.Transparency;
  3405. new.Name=v.Name;
  3406. new.RotVelocity=v.RotVelocity;
  3407. new.Velocity=v.Velocity;
  3408. new.Anchored=v.Anchored;
  3409. new.CanCollide=v.CanCollide;
  3410. new.Locked=v.Locked;
  3411. new.Elasticity=v.Elasticity;
  3412. new.Friction=v.Friction;
  3413. new.BackSurface=v.BackSurface
  3414. new.BottomSurface=v.BottomSurface
  3415. new.FrontSurface=v.FrontSurface
  3416. new.LeftSurface=v.LeftSurface
  3417. new.RightSurface=v.RightSurface
  3418. new.TopSurface=v.TopSurface
  3419. for _,a in pairs(v:GetChildren()) do
  3420. a:clone().Parent=new;
  3421. end
  3422. new.Parent=par;
  3423. after[i]={new};
  3424. Selection.Add(new);
  3425. made_change=true;
  3426. elseif FunctionData.Shape.Mode=="Sphere" and v.className=="Part" and v.Shape~=Enum.PartType.Ball then
  3427. local cf=v.CFrame;
  3428. v.Shape=Enum.PartType.Ball;
  3429. v.CFrame=cf;
  3430. after[i]={nil, Enum.PartType.Ball};
  3431. made_change=true;
  3432. elseif FunctionData.Shape.Mode=="Cylinder" and v.className~="Part" then
  3433. local par=v.Parent;
  3434. v.Parent=nil;
  3435. Selection.Remove(v);
  3436. local new=Instance.new("Part");
  3437. new.Shape=Enum.PartType.Cylinder;
  3438. if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
  3439. new.FormFactor=v.FormFactor;
  3440. else
  3441. new.FormFactor=Enum.FormFactor.Custom;
  3442. end
  3443. new.Size=v.Size;
  3444. new.CFrame=v.CFrame;
  3445. new.BrickColor=v.BrickColor;
  3446. new.Material=v.Material;
  3447. new.Reflectance=v.Reflectance;
  3448. new.Transparency=v.Transparency;
  3449. new.Name=v.Name;
  3450. new.RotVelocity=v.RotVelocity;
  3451. new.Velocity=v.Velocity;
  3452. new.Anchored=v.Anchored;
  3453. new.CanCollide=v.CanCollide;
  3454. new.Locked=v.Locked;
  3455. new.Elasticity=v.Elasticity;
  3456. new.Friction=v.Friction;
  3457. new.BackSurface=v.BackSurface
  3458. new.BottomSurface=v.BottomSurface
  3459. new.FrontSurface=v.FrontSurface
  3460. new.LeftSurface=v.LeftSurface
  3461. new.RightSurface=v.RightSurface
  3462. new.TopSurface=v.TopSurface
  3463. for _,a in pairs(v:GetChildren()) do
  3464. a:clone().Parent=new;
  3465. end
  3466. new.Parent=par;
  3467. after[i]={new};
  3468. Selection.Add(new);
  3469. made_change=true;
  3470. elseif FunctionData.Shape.Mode=="Cylinder" and v.className=="Part" and v.Shape~=Enum.PartType.Cylinder then
  3471. local cf=v.CFrame;
  3472. v.Shape=Enum.PartType.Cylinder;
  3473. v.CFrame=cf;
  3474. after[i]={nil, Enum.PartType.Cylinder};
  3475. made_change=true;
  3476. elseif FunctionData.Shape.Mode=="Truss" and v.className~="TrussPart" then
  3477. local par=v.Parent;
  3478. v.Parent=nil;
  3479. Selection.Remove(v);
  3480. local new=Instance.new("TrussPart");
  3481. new.Size=v.Size;
  3482. new.CFrame=v.CFrame;
  3483. new.BrickColor=v.BrickColor;
  3484. new.Material=v.Material;
  3485. new.Reflectance=v.Reflectance;
  3486. new.Transparency=v.Transparency;
  3487. new.Name=v.Name;
  3488. new.RotVelocity=v.RotVelocity;
  3489. new.Velocity=v.Velocity;
  3490. new.Anchored=v.Anchored;
  3491. new.CanCollide=v.CanCollide;
  3492. new.Locked=v.Locked;
  3493. new.Elasticity=v.Elasticity;
  3494. new.Friction=v.Friction;
  3495. new.BackSurface=v.BackSurface
  3496. new.BottomSurface=v.BottomSurface
  3497. new.FrontSurface=v.FrontSurface
  3498. new.LeftSurface=v.LeftSurface
  3499. new.RightSurface=v.RightSurface
  3500. new.TopSurface=v.TopSurface
  3501. for _,a in pairs(v:GetChildren()) do
  3502. a:clone().Parent=new;
  3503. end
  3504. new.Parent=par;
  3505. after[i]={new};
  3506. Selection.Add(new);
  3507. made_change=true;
  3508. elseif FunctionData.Shape.Mode=="SpawnLocation" and v.className~="SpawnLocation" then
  3509. local par=v.Parent;
  3510. v.Parent=nil;
  3511. Selection.Remove(v);
  3512. local new=Instance.new("SpawnLocation");
  3513. if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
  3514. new.FormFactor=v.FormFactor;
  3515. else
  3516. new.FormFactor=Enum.FormFactor.Custom;
  3517. end
  3518. new.Size=v.Size;
  3519. new.CFrame=v.CFrame;
  3520. new.BrickColor=v.BrickColor;
  3521. new.Material=v.Material;
  3522. new.Reflectance=v.Reflectance;
  3523. new.Transparency=v.Transparency;
  3524. new.Name=v.Name;
  3525. new.RotVelocity=v.RotVelocity;
  3526. new.Velocity=v.Velocity;
  3527. new.Anchored=v.Anchored;
  3528. new.CanCollide=v.CanCollide;
  3529. new.Locked=v.Locked;
  3530. new.Elasticity=v.Elasticity;
  3531. new.Friction=v.Friction;
  3532. new.BackSurface=v.BackSurface
  3533. new.BottomSurface=v.BottomSurface
  3534. new.FrontSurface=v.FrontSurface
  3535. new.LeftSurface=v.LeftSurface
  3536. new.RightSurface=v.RightSurface
  3537. new.TopSurface=v.TopSurface
  3538. for _,a in pairs(v:GetChildren()) do
  3539. a:clone().Parent=new;
  3540. end
  3541. new.Parent=par;
  3542. after[i]={new};
  3543. Selection.Add(new);
  3544. made_change=true;
  3545. elseif FunctionData.Shape.Mode=="Seat" and v.className~="Seat" then
  3546. local par=v.Parent;
  3547. v.Parent=nil;
  3548. Selection.Remove(v);
  3549. local new=Instance.new("Seat");
  3550. if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
  3551. new.FormFactor=v.FormFactor;
  3552. else
  3553. new.FormFactor=Enum.FormFactor.Custom;
  3554. end
  3555. new.Size=v.Size;
  3556. new.CFrame=v.CFrame;
  3557. new.BrickColor=v.BrickColor;
  3558. new.Material=v.Material;
  3559. new.Reflectance=v.Reflectance;
  3560. new.Transparency=v.Transparency;
  3561. new.Name=v.Name;
  3562. new.RotVelocity=v.RotVelocity;
  3563. new.Velocity=v.Velocity;
  3564. new.Anchored=v.Anchored;
  3565. new.CanCollide=v.CanCollide;
  3566. new.Locked=v.Locked;
  3567. new.Elasticity=v.Elasticity;
  3568. new.Friction=v.Friction;
  3569. new.BackSurface=v.BackSurface
  3570. new.BottomSurface=v.BottomSurface
  3571. new.FrontSurface=v.FrontSurface
  3572. new.LeftSurface=v.LeftSurface
  3573. new.RightSurface=v.RightSurface
  3574. new.TopSurface=v.TopSurface
  3575. for _,a in pairs(v:GetChildren()) do
  3576. a:clone().Parent=new;
  3577. end
  3578. new.Parent=par;
  3579. after[i]={new};
  3580. Selection.Add(new);
  3581. made_change=true;
  3582. elseif FunctionData.Shape.Mode=="VehicleSeat" and v.className~="VehicleSeat" then
  3583. local par=v.Parent;
  3584. v.Parent=nil;
  3585. Selection.Remove(v);
  3586. local new=Instance.new("VehicleSeat");
  3587. new.Size=v.Size;
  3588. new.CFrame=v.CFrame;
  3589. new.BrickColor=v.BrickColor;
  3590. new.Material=v.Material;
  3591. new.Reflectance=v.Reflectance;
  3592. new.Transparency=v.Transparency;
  3593. new.Name=v.Name;
  3594. new.RotVelocity=v.RotVelocity;
  3595. new.Velocity=v.Velocity;
  3596. new.Anchored=v.Anchored;
  3597. new.CanCollide=v.CanCollide;
  3598. new.Locked=v.Locked;
  3599. new.Elasticity=v.Elasticity;
  3600. new.Friction=v.Friction;
  3601. new.BackSurface=v.BackSurface
  3602. new.BottomSurface=v.BottomSurface
  3603. new.FrontSurface=v.FrontSurface
  3604. new.LeftSurface=v.LeftSurface
  3605. new.RightSurface=v.RightSurface
  3606. new.TopSurface=v.TopSurface
  3607. for _,a in pairs(v:GetChildren()) do
  3608. a:clone().Parent=new;
  3609. end
  3610. new.Parent=par;
  3611. after[i]={new};
  3612. Selection.Add(new);
  3613. made_change=true;
  3614. elseif FunctionData.Shape.Mode=="Skateboard" and v.className~="SkateboardPlatform" then
  3615. local par=v.Parent;
  3616. v.Parent=nil;
  3617. Selection.Remove(v);
  3618. local new=Instance.new("SkateboardPlatform");
  3619. if v:IsA("BasePart") and not v:IsA("TrussPart") and not v:IsA("VehicleSeat") then
  3620. new.FormFactor=v.FormFactor;
  3621. else
  3622. new.FormFactor=Enum.FormFactor.Custom;
  3623. end
  3624. new.Size=v.Size;
  3625. new.CFrame=v.CFrame;
  3626. new.BrickColor=v.BrickColor;
  3627. new.Material=v.Material;
  3628. new.Reflectance=v.Reflectance;
  3629. new.Transparency=v.Transparency;
  3630. new.Name=v.Name;
  3631. new.RotVelocity=v.RotVelocity;
  3632. new.Velocity=v.Velocity;
  3633. new.Anchored=v.Anchored;
  3634. new.CanCollide=v.CanCollide;
  3635. new.Locked=v.Locked;
  3636. new.Elasticity=v.Elasticity;
  3637. new.Friction=v.Friction;
  3638. new.BackSurface=v.BackSurface
  3639. new.BottomSurface=v.BottomSurface
  3640. new.FrontSurface=v.FrontSurface
  3641. new.LeftSurface=v.LeftSurface
  3642. new.RightSurface=v.RightSurface
  3643. new.TopSurface=v.TopSurface
  3644. for _,a in pairs(v:GetChildren()) do
  3645. a:clone().Parent=new;
  3646. end
  3647. new.Parent=par;
  3648. after[i]={new};
  3649. Selection.Add(new);
  3650. made_change=true;
  3651. end
  3652. end
  3653. if made_change then History.Action("Shape", parts, prior, after); end
  3654. return;
  3655. else
  3656. Passive(p);
  3657. end
  3658. end
  3659.  
  3660. FunctionData.Shape = FunctionData.Shape or {};
  3661. FunctionData.Shape.Mode = FunctionData.Shape.Mode or "Brick";
  3662.  
  3663. 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)
  3664. 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)
  3665. 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)
  3666. 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)
  3667. 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)
  3668. 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)
  3669. 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)
  3670. 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)
  3671. 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)
  3672. 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)
  3673. obj40.Parent=obj1;
  3674.  
  3675. function RefreshButtons()
  3676. obj41.BackgroundColor3 = FunctionData.Shape.Mode=="Brick" and Options.SelectedColor or Options.ButtonColor;
  3677. obj42.BackgroundColor3 = FunctionData.Shape.Mode=="Wedge" and Options.SelectedColor or Options.ButtonColor;
  3678. obj43.BackgroundColor3 = FunctionData.Shape.Mode=="Sphere" and Options.SelectedColor or Options.ButtonColor;
  3679. obj44.BackgroundColor3 = FunctionData.Shape.Mode=="Truss" and Options.SelectedColor or Options.ButtonColor;
  3680. obj45.BackgroundColor3 = FunctionData.Shape.Mode=="Cylinder" and Options.SelectedColor or Options.ButtonColor;
  3681. obj46.BackgroundColor3 = FunctionData.Shape.Mode=="SpawnLocation" and Options.SelectedColor or Options.ButtonColor;
  3682. obj47.BackgroundColor3 = FunctionData.Shape.Mode=="Seat" and Options.SelectedColor or Options.ButtonColor;
  3683. obj48.BackgroundColor3 = FunctionData.Shape.Mode=="VehicleSeat" and Options.SelectedColor or Options.ButtonColor;
  3684. obj49.BackgroundColor3 = FunctionData.Shape.Mode=="Skateboard" and Options.SelectedColor or Options.ButtonColor;
  3685. end
  3686.  
  3687. obj41.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Brick"; RefreshButtons(); end)
  3688. obj42.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Wedge"; RefreshButtons(); end)
  3689. obj43.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Sphere"; RefreshButtons(); end)
  3690. obj44.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Truss"; RefreshButtons(); end)
  3691. obj45.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Cylinder"; RefreshButtons(); end)
  3692. obj46.MouseButton1Down:connect(function() FunctionData.Shape.Mode="SpawnLocation"; RefreshButtons(); end)
  3693. obj47.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Seat"; RefreshButtons(); end)
  3694. obj48.MouseButton1Down:connect(function() FunctionData.Shape.Mode="VehicleSeat"; RefreshButtons(); end)
  3695. obj49.MouseButton1Down:connect(function() FunctionData.Shape.Mode="Skateboard"; RefreshButtons(); end)
  3696.  
  3697. RefreshButtons();
  3698.  
  3699. end
  3700.  
  3701. PaletteFunctions = PaletteFunctions or {};
  3702.  
  3703. function PaletteFunctions.Surface()
  3704.  
  3705. function Active(p) --p accepts a table of parameters.
  3706. local c=p[1]; --c is command.
  3707. if c=="Unload" then
  3708. obj40.Parent=nil;
  3709. sb.Parent=nil;
  3710. return;
  3711. elseif c=="KeyDown" then
  3712. if string.byte(p[3])==9 then
  3713. HitButton(gui26);
  3714. end
  3715. Passive(p);
  3716. return;
  3717. elseif c=="Button1Down" then
  3718. if p[2].Target~=nil and FunctionData.Surface.Choosing then
  3719. sb.Visible=false;
  3720. FunctionData.Surface.Choosing=false;
  3721. FunctionData.Surface.Face=p[2].TargetSurface;
  3722. RefreshButtons();
  3723. end
  3724. Passive(p);
  3725. elseif c=="Move" then
  3726. if FunctionData.Surface.Choosing and p[2].Target~=nil then
  3727. sb.Adornee=p[2].Target;
  3728. sb.TargetSurface=p[2].TargetSurface;
  3729. end
  3730. Passive(p);
  3731. return;
  3732. elseif c=="Apply" then
  3733. made_a_change=false;
  3734. prior={};
  3735. parts=HasPermission(GetParts(Selection.Get()), "surface");
  3736. for i,v in pairs(parts) do
  3737. if FunctionData.Surface.Face==Enum.NormalId.Left then
  3738. prior[i]=v.LeftSurface;
  3739. v.LeftSurface=FunctionData.Surface.Mode;
  3740. if v.LeftSurface~=FunctionData.Surface.Mode then
  3741. made_a_change=true;
  3742. end
  3743. elseif FunctionData.Surface.Face==Enum.NormalId.Right then
  3744. prior[i]=v.RightSurface;
  3745. v.RightSurface=FunctionData.Surface.Mode;
  3746. if v.RightSurface~=FunctionData.Surface.Mode then
  3747. made_a_change=true;
  3748. end
  3749. elseif FunctionData.Surface.Face==Enum.NormalId.Top then
  3750. prior[i]=v.TopSurface;
  3751. v.TopSurface=FunctionData.Surface.Mode;
  3752. if v.TopSurface~=FunctionData.Surface.Mode then
  3753. made_a_change=true;
  3754. end
  3755. elseif FunctionData.Surface.Face==Enum.NormalId.Bottom then
  3756. prior[i]=v.BottomSurface;
  3757. v.BottomSurface=FunctionData.Surface.Mode;
  3758. if v.BottomSurface~=FunctionData.Surface.Mode then
  3759. made_a_change=true;
  3760. end
  3761. elseif FunctionData.Surface.Face==Enum.NormalId.Front then
  3762. prior[i]=v.FrontSurface;
  3763. v.FrontSurface=FunctionData.Surface.Mode;
  3764. if v.FrontSurface~=FunctionData.Surface.Mode then
  3765. made_a_change=true;
  3766. end
  3767. elseif FunctionData.Surface.Face==Enum.NormalId.Back then
  3768. prior[i]=v.BackSurface;
  3769. v.BackSurface=FunctionData.Surface.Mode;
  3770. if v.BackSurface~=FunctionData.Surface.Mode then
  3771. made_a_change=true;
  3772. end
  3773. end
  3774. end
  3775. History.Action("Surface", parts, FunctionData.Surface.Face, prior, FunctionData.Surface.Mode);
  3776. return;
  3777. else
  3778. Passive(p);
  3779. end
  3780. end
  3781.  
  3782. FunctionData.Surface = FunctionData.Surface or {};
  3783. FunctionData.Surface.Mode = FunctionData.Surface.Mode or Enum.SurfaceType.Smooth;
  3784. FunctionData.Surface.Face = FunctionData.Surface.Face or Enum.NormalId.Left;
  3785. FunctionData.Surface.Choosing = false;
  3786.  
  3787. 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)
  3788. 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)
  3789. 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)
  3790. 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)
  3791. 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)
  3792. 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)
  3793. 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)
  3794. 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)
  3795. 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)
  3796. 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)
  3797. 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)
  3798. 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)
  3799. 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)
  3800. 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)
  3801. 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)
  3802. 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)
  3803. obj40.Parent=obj1;
  3804.  
  3805. sb=Instance.new("SurfaceSelection");
  3806. sb.Color=Options.SurfaceSelectionColor;
  3807. sb.Visible=false;
  3808. sb.Parent=obj40;
  3809.  
  3810. function RefreshButtons()
  3811. for i,v in pairs({obj41, obj42, obj43, obj44, obj45, obj46, obj47, obj48}) do
  3812. v.BackgroundColor3=Options.ButtonColor;
  3813. end
  3814. if FunctionData.Surface.Mode==Enum.SurfaceType.Weld then obj41.BackgroundColor3=Options.SelectedColor; end
  3815. if FunctionData.Surface.Mode==Enum.SurfaceType.Universal then obj42.BackgroundColor3=Options.SelectedColor; end
  3816. if FunctionData.Surface.Mode==Enum.SurfaceType.Hinge then obj43.BackgroundColor3=Options.SelectedColor; end
  3817. if FunctionData.Surface.Mode==Enum.SurfaceType.Inlet then obj44.BackgroundColor3=Options.SelectedColor; end
  3818. if FunctionData.Surface.Mode==Enum.SurfaceType.Smooth then obj45.BackgroundColor3=Options.SelectedColor; end
  3819. if FunctionData.Surface.Mode==Enum.SurfaceType.Studs then obj46.BackgroundColor3=Options.SelectedColor; end
  3820. if FunctionData.Surface.Mode==Enum.SurfaceType.Motor then obj47.BackgroundColor3=Options.SelectedColor; end
  3821. if FunctionData.Surface.Mode==Enum.SurfaceType.Glue then obj48.BackgroundColor3=Options.SelectedColor; end
  3822. for i,v in pairs({obj49, obj50, obj51, obj52, obj53, obj54, obj55}) do
  3823. v.BackgroundColor3=Options.ButtonColor;
  3824. end
  3825. if FunctionData.Surface.Choosing then
  3826. obj55.BackgroundColor3=Options.SelectedColor;
  3827. else
  3828. if FunctionData.Surface.Face==Enum.NormalId.Left then obj49.BackgroundColor3=Options.SelectedColor; end
  3829. if FunctionData.Surface.Face==Enum.NormalId.Right then obj50.BackgroundColor3=Options.SelectedColor; end
  3830. if FunctionData.Surface.Face==Enum.NormalId.Top then obj51.BackgroundColor3=Options.SelectedColor; end
  3831. if FunctionData.Surface.Face==Enum.NormalId.Bottom then obj52.BackgroundColor3=Options.SelectedColor; end
  3832. if FunctionData.Surface.Face==Enum.NormalId.Front then obj53.BackgroundColor3=Options.SelectedColor; end
  3833. if FunctionData.Surface.Face==Enum.NormalId.Back then obj54.BackgroundColor3=Options.SelectedColor; end
  3834. end
  3835. end
  3836.  
  3837. obj41.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Weld; RefreshButtons(); end)
  3838. obj42.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Universal; RefreshButtons(); end)
  3839. obj43.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Hinge; RefreshButtons(); end)
  3840. obj44.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Inlet; RefreshButtons(); end)
  3841. obj45.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Smooth; RefreshButtons(); end)
  3842. obj46.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Studs; RefreshButtons(); end)
  3843. obj47.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Motor; RefreshButtons(); end)
  3844. obj48.MouseButton1Down:connect(function() FunctionData.Surface.Mode=Enum.SurfaceType.Glue; RefreshButtons(); end)
  3845.  
  3846. obj49.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Left; RefreshButtons(); end)
  3847. obj50.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Right; RefreshButtons(); end)
  3848. obj51.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Top; RefreshButtons(); end)
  3849. obj52.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Bottom; RefreshButtons(); end)
  3850. obj53.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Front; RefreshButtons(); end)
  3851. obj54.MouseButton1Down:connect(function() FunctionData.Surface.Face=Enum.NormalId.Back; RefreshButtons(); end)
  3852.  
  3853. obj55.MouseButton1Down:connect(function()
  3854. FunctionData.Surface.Choosing=true;
  3855. sb.Adornee=nil;
  3856. sb.Visible=true;
  3857. RefreshButtons();
  3858. end)
  3859. end
  3860.  
  3861. --[[
  3862. void TB.insert(textbox as TextBox, textbutton as TextButton)
  3863. void TB.enter()
  3864. void TB.remove(item as TextBox, item as TextButton)
  3865. void TB.clean()
  3866. ]]
  3867.  
  3868. TB={
  3869. insert=function(textbox,textbutton)
  3870. local cxn1=textbutton.MouseEnter:connect(function()
  3871. textbox.Visible=true;
  3872. TB.current=textbutton;
  3873. end);
  3874. local cxn2=textbutton.MouseLeave:connect(function()
  3875. wait()
  3876. textbox.Visible=false;
  3877. if TB.current==textbutton then
  3878. TB.current=nil;
  3879. end
  3880. end);
  3881. local cxn3=textbutton.MouseButton1Down:connect(function()
  3882. TB.enter();
  3883. end);
  3884. table.insert(TB.items,{textbox,textbutton,cxn1,cxn2,cxn3});
  3885. end,
  3886.  
  3887. enter=function()
  3888. for i,v in pairs(TB.items) do
  3889. if v[2]==TB.current then
  3890. TB.current.Text=v[1].Text;
  3891. end
  3892. end
  3893. end,
  3894.  
  3895. remove=function(item)
  3896. for i,v in pairs(TB.items) do
  3897. if item==v[1] or item==v[2] then
  3898. v[3]:disconnect();
  3899. v[4]:disconnect();
  3900. v[5]:disconnect();
  3901. table.remove(TB.items,i);
  3902. if TB.current==v[2] then
  3903. TB.current=nil;
  3904. end
  3905. end
  3906. end
  3907. end,
  3908.  
  3909. clean=function()
  3910. for i=#TB.items,1,-1 do
  3911. if TB.items[i][1].Parent==nil and TB.items[i][2].Parent==nil then
  3912. TB.items[i][3]:disconnect();
  3913. TB.items[i][4]:disconnect();
  3914. TB.items[i][5]:disconnect();
  3915. table.remove(TB.items,i);
  3916. end
  3917. end
  3918. end,
  3919.  
  3920. current=nil,
  3921.  
  3922. items={},
  3923. };
  3924.  
  3925. PaletteFunctions = PaletteFunctions or {};
  3926.  
  3927. function PaletteFunctions.Transparency()
  3928.  
  3929. function Active(p)
  3930. local c=p[1];
  3931. if c=="Unload" then
  3932. obj40.Parent=nil;
  3933. TB.remove(obj41);
  3934. FunctionData.Transparency.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
  3935. return;
  3936. elseif c=="KeyDown" then
  3937. if string.byte(p[3])==9 then
  3938. HitButton(gui26);
  3939. Spawn(function()
  3940. local t = tab_index;
  3941. wait(Options.RepeatDelay);
  3942. while keys.check(9) and t==tab_index do
  3943. HitButton(gui26);
  3944. wait(Options.RepeatRate);
  3945. end
  3946. end);
  3947. end
  3948. Passive(p);
  3949. return;
  3950. elseif c=="KeyUp" then
  3951. if string.byte(p[3])==9 then
  3952. tab_index = tab_index + 1;
  3953. end
  3954. Passive(p);
  3955. elseif c=="Apply" then
  3956. prior={};
  3957. after={};
  3958. parts=HasPermission(GetParts(Selection.Get()), "transparency");
  3959. FunctionData.Transparency.Value = (tonumber(obj42.Text=="" and "0" or obj42.Text) or 0);
  3960. for i,v in pairs(parts) do
  3961. prior[i]=v.Transparency;
  3962. if FunctionData.Transparency.Relative then
  3963. v.Transparency=math.min(1, math.max(0, v.Transparency+FunctionData.Transparency.Value));
  3964. else
  3965. v.Transparency=math.min(1, math.max(0, FunctionData.Transparency.Value));
  3966. end
  3967. after[i]=v.Transparency;
  3968. end
  3969. pass_action=false;
  3970. for i,v in pairs(prior) do
  3971. if prior[i]~=after[i] then
  3972. pass_action=true;
  3973. end
  3974. end
  3975. if pass_action then
  3976. History.Action("Transparency", parts, prior, after);
  3977. end
  3978. return;
  3979. else
  3980. Passive(p);
  3981. end
  3982. end
  3983.  
  3984. tab_index=0;
  3985.  
  3986. FunctionData.Transparency = FunctionData.Transparency or {};
  3987. FunctionData.Transparency.Relative = FunctionData.Transparency.Relative or false;
  3988. FunctionData.Transparency.Value = FunctionData.Transparency.Value or 0.5;
  3989.  
  3990. 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)
  3991. 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
  3992. 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)
  3993. 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)
  3994.  
  3995. obj42.Text = tostring(FunctionData.Transparency.Value);
  3996. obj40.Parent=obj1;
  3997. TB.insert(obj41, obj42);
  3998.  
  3999. function RefreshButtons()
  4000. obj43.Text = FunctionData.Transparency.Relative and "Relative" or "Constant";
  4001. end
  4002.  
  4003. obj43.MouseButton1Down:connect(function()
  4004. FunctionData.Transparency.Relative = not FunctionData.Transparency.Relative;
  4005. RefreshButtons();
  4006. end)
  4007.  
  4008. RefreshButtons();
  4009.  
  4010. end
  4011.  
  4012. --[[ Utilities ]]
  4013.  
  4014. PaletteFunctions = PaletteFunctions or {};
  4015.  
  4016. function PaletteFunctions.Utilities()
  4017.  
  4018. function Active(p) --p accepts a table of parameters.
  4019. local c=p[1]; --c is command.
  4020. if c=="Unload" then
  4021. obj40.Parent=nil;
  4022. return;
  4023. else
  4024. Passive(p);
  4025. end
  4026. end
  4027.  
  4028. modes={};
  4029. for i,v in pairs(script:GetChildren()) do
  4030. if string.sub(v.Name,1,8)=="Utility:" and v:IsA("StringValue") then
  4031. modes[#modes+1]=v;
  4032. end
  4033. end
  4034. for i,v in pairs(script.Parent:GetChildren()) do
  4035. if string.sub(v.Name,1,8)=="Utility:" and v:IsA("StringValue") then
  4036. modes[#modes+1]=v;
  4037. end
  4038. end
  4039.  
  4040.  
  4041. rows=1;
  4042. width=140;
  4043. height=20;
  4044. buffer=2;
  4045. obj40=Instance.new("Frame") obj40.Name="Utilities" obj40.Position=UDim2.new(0,243,1,-200)
  4046. obj40.Size=UDim2.new(0, math.ceil((#modes)/4)*(width+buffer)+buffer, 0, (#modes>=4 and 4 or (#modes)%4)*(height+buffer)+buffer);
  4047. for i,v in pairs(modes) do
  4048. local obj41=Instance.new("TextButton");
  4049. obj41.Size=UDim2.new(0, 140, 0, 20);
  4050. obj41.Position=UDim2.new(0, math.floor((i-1)/rows)*(width+buffer)+buffer, 0, (i-1)%rows*(height+buffer)+buffer);
  4051. obj41.Parent=obj40;
  4052. obj41.Text=string.sub(v.Name, 9);
  4053. obj41.BackgroundColor3=Options.ButtonColor;
  4054. obj41.MouseButton1Down:connect(function()
  4055. input("Unload");
  4056. if v~=nil then
  4057. assert(loadstring(v.Value))();
  4058. end
  4059. end)
  4060. end
  4061. obj40.Parent=obj1;
  4062.  
  4063.  
  4064.  
  4065. end
  4066.  
  4067. PaletteFunctions = PaletteFunctions or {};
  4068.  
  4069. function PaletteFunctions.Velocity()
  4070.  
  4071. function Active(p) --p accepts a table of parameters.
  4072. local c=p[1]; --c is command.
  4073. if c=="Unload" then
  4074. FunctionData.Velocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  4075. FunctionData.Velocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  4076. FunctionData.Velocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  4077. obj40.Parent=nil;
  4078. TB.remove(obj41);
  4079. TB.remove(obj43);
  4080. TB.remove(obj45);
  4081. return;
  4082. elseif c=="KeyDown" then
  4083. if string.byte(p[3])==9 then
  4084. HitButton(gui26);
  4085. end
  4086. Passive(p);
  4087. return;
  4088. elseif c=="Apply" then
  4089. FunctionData.Velocity.x = tonumber(obj42.Text == "" and 0 or obj42.Text) or 0;
  4090. FunctionData.Velocity.y = tonumber(obj44.Text == "" and 0 or obj44.Text) or 0;
  4091. FunctionData.Velocity.z = tonumber(obj46.Text == "" and 0 or obj46.Text) or 0;
  4092. prior={};
  4093. parts=HasPermission(GetParts(Selection.Get()), "velocity");
  4094. for i,v in pairs(parts) do
  4095. prior[i]=v.Velocity;
  4096. v.Velocity=Vector3.new(FunctionData.Velocity.x, FunctionData.Velocity.y, FunctionData.Velocity.z);
  4097. end
  4098. History.Action("Velocity", parts, prior, Vector3.new(FunctionData.Velocity.x, FunctionData.Velocity.y, FunctionData.Velocity.z));
  4099. return;
  4100. else
  4101. Passive(p);
  4102. end
  4103. end
  4104.  
  4105. FunctionData.Velocity = FunctionData.Velocity or {};
  4106. FunctionData.Velocity.x = FunctionData.Velocity.x or 0;
  4107. FunctionData.Velocity.y = FunctionData.Velocity.y or 0;
  4108. FunctionData.Velocity.z = FunctionData.Velocity.z or 0;
  4109.  
  4110.  
  4111. 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);
  4112. 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;
  4113. 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);
  4114. 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;
  4115. 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);
  4116. 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;
  4117. 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);
  4118. obj42.Text=FunctionData.Velocity.x;
  4119. obj44.Text=FunctionData.Velocity.y;
  4120. obj46.Text=FunctionData.Velocity.z;
  4121. obj40.Parent=obj1;
  4122.  
  4123. TB.insert(obj41, obj42);
  4124. TB.insert(obj43, obj44);
  4125. TB.insert(obj45, obj46);
  4126.  
  4127. end
  4128.  
  4129. Drag={};
  4130.  
  4131. Drag.Dragging=false;
  4132. Drag.Main=nil;
  4133. Drag.Offset=Vector3.new();
  4134. Drag.Parts={};
  4135.  
  4136. Drag.Dragger=Instance.new("Dragger");
  4137.  
  4138. Drag.Down=function(main, offset, parts)
  4139. if not Drag.Dragging then
  4140. Drag.OriginalPositions={};
  4141. for i,v in pairs(parts) do
  4142. Drag.OriginalPositions[#Drag.OriginalPositions+1]=v.CFrame;
  4143. end
  4144. Drag.Dragger:MouseDown(main, offset, parts);
  4145. Drag.Dragging=true;
  4146. Drag.Main=main;
  4147. Drag.Offset=offset;
  4148. Drag.Parts=parts;
  4149. end
  4150. end;
  4151.  
  4152. Drag.Up=function()
  4153. if Drag.Dragging then
  4154. local change=false;
  4155. local FinalPositions={};
  4156. for i,v in pairs(Drag.Parts) do
  4157. FinalPositions[#FinalPositions+1]=v.CFrame;
  4158. if Drag.OriginalPositions[i]~=v.CFrame then
  4159. change=true;
  4160. end
  4161. end
  4162. if change then
  4163. History.Action("Move", Drag.Parts, Drag.OriginalPositions, FinalPositions);
  4164. end
  4165. Drag.Dragger:MouseUp();
  4166. Drag.Dragging=false;
  4167. Drag.Main=nil;
  4168. Drag.Offset=Vector3.new();
  4169. Drag.Parts={};
  4170. end
  4171. end
  4172.  
  4173. Drag.Move=function(unitray)
  4174. if Drag.Dragging then
  4175. Drag.Dragger:MouseMove(unitray);
  4176. end
  4177. end
  4178.  
  4179. Drag.Rotate=function(axis)
  4180. if Drag.Dragging then
  4181. Drag.Dragger:AxisRotate(axis)
  4182. end
  4183. end
  4184.  
  4185. CloneOver="http://www.roblox.com/asset/?id=37596643";
  4186. Draggable="http://www.roblox.com/asset/?id=37596643";
  4187. Dragging="http://www.roblox.com/asset/?id=37596650";
  4188. Default="http://www.roblox.com/asset/?id=37596618";
  4189. Selectable="http://www.roblox.com/asset/?id=37596643";
  4190.  
  4191. function GetIcon(part)
  4192. if Drag.Dragging then
  4193. return Dragging;
  4194. end
  4195. if part~=nil then
  4196. if Selection.Check(part) and Permission(part, "drag") then
  4197. return Draggable;
  4198. elseif not Selection.Check(part) and Permission(part, "select") then
  4199. return Selectable;
  4200. elseif Permission(part, "clone") then
  4201. return CloneOver;
  4202. end
  4203. end
  4204. return Default;
  4205. end;
  4206.  
  4207. --[[ GetParts ]]
  4208.  
  4209. function Recurse(t)
  4210. local p={}
  4211. for i,v in pairs(t) do
  4212. if v:IsA("BasePart") then table.insert(p,v); end
  4213. if #v:GetChildren()>0 then
  4214. local parts=Recurse(v:GetChildren(),p);
  4215. for a,b in pairs(parts) do
  4216. table.insert(p,b);
  4217. end
  4218. end
  4219. end
  4220. return p;
  4221. end
  4222.  
  4223. function GetParts(t)
  4224. p=Recurse(t)
  4225. return p;
  4226. end
  4227.  
  4228. --</import>
  4229.  
  4230. script.ChildAdded:connect(function(child)
  4231. if child:IsA("StringValue") and not string.find(child.Name, ":") then
  4232. assert(loadstring(child.Value))();
  4233. end
  4234. end)
  4235. script.Parent.ChildAdded:connect(function(child)
  4236. if child:IsA("StringValue") and not string.find(child.Name, ":") then
  4237. assert(loadstring(child.Value))();
  4238. end
  4239. end)
  4240.  
  4241. function onButton1Down(mouse)
  4242. input("Button1Down", mouse);
  4243. end
  4244.  
  4245. function onButton1Up(mouse)
  4246. input("Button1Up", mouse);
  4247. end
  4248.  
  4249. function onKeyDown(key,mouse)
  4250. input("KeyDown", mouse, key);
  4251. end
  4252.  
  4253. function onKeyUp(key,mouse)
  4254. input("KeyUp", mouse, key);
  4255. end
  4256.  
  4257. function onMove(mouse)
  4258. input("Move", mouse);
  4259. end
  4260.  
  4261. function onSelected(mouse)
  4262. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  4263. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  4264. mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
  4265. mouse.KeyUp:connect(function(key) onKeyUp(key,mouse) end)
  4266. mouse.Move:connect(function() onMove(mouse) end)
  4267. LocalBin.Parent=workspace.CurrentCamera;
  4268. mouse.TargetFilter=LocalBin;
  4269. if player and player:findFirstChild("PlayerGui") then
  4270. gui.Parent=player.PlayerGui;
  4271. else
  4272. player=game.Players.LocalPlayer;
  4273. end
  4274. end
  4275.  
  4276. function onDeselected(mouse)
  4277. gui.Parent=nil;
  4278. LocalBin.Parent=nil;
  4279. end
  4280.  
  4281. Build.Selected:connect(onSelected)
  4282. Build.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement