Advertisement
trixade

Untitled

Apr 28th, 2022
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.67 KB | None | 0 0
  1. repeat wait() until workspace:FindFirstChild("MenuLobby")
  2. if not isfolder("PFSkins") then makefolder("PFSkins") end
  3. local statText = Drawing.new("Text")
  4. statText.Visible = false
  5. statText.Font = 1
  6. statText.Color = Color3.fromRGB(255,255,255)
  7. statText.Center = true
  8. statText.Size = 20
  9. function say(x,y)
  10.    local y = y or 1
  11.    statText.Visible = true
  12.    statText.Text = x
  13.    delay(y,function()statText.Visible = false end)
  14. end
  15. local function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end
  16. if game.CoreGui:FindFirstChild("PFSkinEditor") then game.CoreGui.PFSkinEditor:Destroy() end
  17. local PFSkinEditor = Instance.new("ScreenGui")
  18. local MainFrame = Instance.new("Frame")
  19. local MainCorner = Instance.new("UICorner")
  20. local MainTitle = Instance.new("TextLabel")
  21. local PartContainer = Instance.new("ScrollingFrame")
  22. local PartListLayout = Instance.new("UIListLayout")
  23. local ExamplePart = Instance.new("TextButton")
  24. local PartCorner = Instance.new("UICorner")
  25. local CPButton = Instance.new("TextButton")
  26. local CPBtnCorner = Instance.new("UICorner")
  27. local ColorPicker = Instance.new("Frame")
  28. local ColorSelection = Instance.new("ImageButton")
  29. local ColorPoint = Instance.new("TextButton")
  30. local ColorCorner = Instance.new("UICorner")
  31. local BrightnessSelection = Instance.new("TextButton")
  32. local BrightGradient = Instance.new("UIGradient")
  33. local BrightPoint = Instance.new("TextButton")
  34. local HexBox = Instance.new("TextBox")
  35. local CopyHexButton = Instance.new("ImageButton")
  36. local MaterialPicker = Instance.new("Frame")
  37. local MaterialSearch = Instance.new("ImageButton")
  38. local MaterialBox = Instance.new("TextBox")
  39. local MaterialContainer = Instance.new("ScrollingFrame")
  40. local MaterialListLayout = Instance.new("UIListLayout")
  41. local ExampleMaterial = Instance.new("TextButton")
  42. local ExampleMatCorner = Instance.new("UICorner")
  43. local MaterialPickerCorner = Instance.new("UICorner")
  44. local CurrentMaterialLabel = Instance.new("TextLabel")
  45. local PartViewer = Instance.new("Frame")
  46. local ViewerCorner = Instance.new("UICorner")
  47. local MainViewer = Instance.new("ViewportFrame")
  48. local ConfigBox = Instance.new("TextBox")
  49. local SaveButton = Instance.new("TextButton")
  50. local ConfigDownload = Instance.new("ImageButton")
  51. local LoadButton = Instance.new("TextButton")
  52. local ConfigLoad = Instance.new("ImageButton")
  53. local DeleteButton = Instance.new("TextButton")
  54. local ConfigDelete = Instance.new("ImageButton")
  55. local VersionLabel = Instance.new("TextLabel")
  56. PFSkinEditor.Name = "PFSkinEditor"
  57. PFSkinEditor.Parent = game.CoreGui
  58. PFSkinEditor.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  59. MainFrame.Name = "MainFrame"
  60. MainFrame.Parent = PFSkinEditor
  61. MainFrame.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
  62. MainFrame.Active = true
  63. MainFrame.Draggable = true
  64. MainFrame.Position = UDim2.new(0.6, 0, 0.3, 0)
  65. MainFrame.Size = UDim2.new(0, 271, 0, 501)
  66. MainCorner.Name = "MainCorner"
  67. MainCorner.Parent = MainFrame
  68. MainTitle.Name = "MainTitle"
  69. MainTitle.Parent = MainFrame
  70. MainTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  71. MainTitle.BackgroundTransparency = 1.000
  72. MainTitle.Size = UDim2.new(0, 271, 0, 30)
  73. MainTitle.Font = Enum.Font.Gotham
  74. currentGun = workspace.MenuLobby.GunStage.GunModel:GetChildren()[1]
  75. MainTitle.Text = "Skin Editor : "..currentGun.Name
  76. MainTitle.TextColor3 = Color3.fromRGB(0, 0, 0)
  77. MainTitle.TextSize = 16.000
  78. PartContainer.Name = "PartContainer"
  79. PartContainer.Parent = MainFrame
  80. PartContainer.Active = true
  81. PartContainer.BackgroundColor3 = Color3.fromRGB(255, 149, 151)
  82. PartContainer.BackgroundTransparency = 1.000
  83. PartContainer.BorderSizePixel = 0
  84. PartContainer.Position = UDim2.new(0.0332103334, 0, 0.059880238, 0)
  85. PartContainer.Size = UDim2.new(0, 253, 0, 420)
  86. PartListLayout.Name = "PartListLayout"
  87. PartListLayout.Parent = PartContainer
  88. PartListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  89. PartListLayout.Padding = UDim.new(0, 5)
  90. ExamplePart.Name = "ExamplePart"
  91. ExamplePart.Parent = PartContainer
  92. ExamplePart.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
  93. ExamplePart.BorderSizePixel = 0
  94. ExamplePart.Size = UDim2.new(0, 233, 0, 27)
  95. ExamplePart.AutoButtonColor = false
  96. ExamplePart.Font = Enum.Font.Gotham
  97. ExamplePart.Text = "  Part Name"
  98. ExamplePart.TextColor3 = Color3.fromRGB(0, 0, 0)
  99. ExamplePart.TextSize = 18.000
  100. ExamplePart.TextXAlignment = Enum.TextXAlignment.Left
  101. ExamplePart.Visible = false
  102. PartCorner.Name = "PartCorner"
  103. PartCorner.Parent = ExamplePart
  104. CPButton.Name = "CPButton"
  105. CPButton.Parent = ExamplePart
  106. CPButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  107. CPButton.BorderSizePixel = 0
  108. CPButton.Position = UDim2.new(0.858369112, 0, 0.111111104, 0)
  109. CPButton.Size = UDim2.new(0, 20, 0, 20)
  110. CPButton.AutoButtonColor = false
  111. CPButton.Font = Enum.Font.SourceSans
  112. CPButton.Text = ""
  113. CPButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  114. CPButton.TextSize = 14.000
  115. CPBtnCorner.Name = "CPBtnCorner"
  116. CPBtnCorner.Parent = CPButton
  117. ColorPicker.Name = "ColorPicker"
  118. ColorPicker.Parent = MainFrame
  119. ColorPicker.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
  120. ColorPicker.BorderSizePixel = 0
  121. ColorPicker.Position = UDim2.new(1.04911077, 0, 0.101796411, 0)
  122. ColorPicker.Size = UDim2.new(0, 170, 0, 195)
  123. ColorPicker.Visible = false
  124. ColorSelection.Name = "ColorSelection"
  125. ColorSelection.Parent = ColorPicker
  126. ColorSelection.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  127. ColorSelection.BorderColor3 = Color3.fromRGB(0, 0, 0)
  128. ColorSelection.BorderSizePixel = 2
  129. ColorSelection.Position = UDim2.new(0.0520231202, 0, 0.0416666679, 0)
  130. ColorSelection.Size = UDim2.new(0, 119, 0, 119)
  131. ColorSelection.Image = "http://www.roblox.com/asset/?id=328298876"
  132. ColorPoint.Name = "ColorPoint"
  133. ColorPoint.Parent = ColorSelection
  134. ColorPoint.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  135. ColorPoint.BorderColor3 = Color3.fromRGB(0, 0, 0)
  136. ColorPoint.Position = UDim2.new(0, 0, 1, -5)
  137. ColorPoint.Size = UDim2.new(0, 5, 0, 5)
  138. ColorPoint.AutoButtonColor = false
  139. ColorPoint.Font = Enum.Font.SourceSans
  140. ColorPoint.Text = ""
  141. ColorPoint.TextColor3 = Color3.fromRGB(0, 0, 0)
  142. ColorPoint.TextSize = 14.000
  143. ColorCorner.Name = "ColorCorner"
  144. ColorCorner.Parent = ColorPicker
  145. BrightnessSelection.Name = "BrightnessSelection"
  146. BrightnessSelection.Parent = ColorPicker
  147. BrightnessSelection.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  148. BrightnessSelection.BorderColor3 = Color3.fromRGB(0, 0, 0)
  149. BrightnessSelection.BorderSizePixel = 2
  150. BrightnessSelection.Position = UDim2.new(0.830133796, 0, 0.0416666679, 0)
  151. BrightnessSelection.Size = UDim2.new(0, 17, 0, 118)
  152. BrightnessSelection.AutoButtonColor = false
  153. BrightnessSelection.Font = Enum.Font.SourceSans
  154. BrightnessSelection.Text = ""
  155. BrightnessSelection.TextColor3 = Color3.fromRGB(0, 0, 0)
  156. BrightnessSelection.TextSize = 14.000
  157. BrightGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(0, 0, 0))}
  158. BrightGradient.Rotation = 90
  159. BrightGradient.Name = "BrightGradient"
  160. BrightGradient.Parent = BrightnessSelection
  161. BrightPoint.Name = "BrightPoint"
  162. BrightPoint.Parent = BrightnessSelection
  163. BrightPoint.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  164. BrightPoint.BorderColor3 = Color3.fromRGB(0, 0, 0)
  165. BrightPoint.Position = UDim2.new(0.5, -3, 0, 0)
  166. BrightPoint.Size = UDim2.new(0, 5, 0, 5)
  167. BrightPoint.AutoButtonColor = false
  168. BrightPoint.Font = Enum.Font.SourceSans
  169. BrightPoint.Text = ""
  170. BrightPoint.TextColor3 = Color3.fromRGB(0, 0, 0)
  171. BrightPoint.TextSize = 14.000
  172. HexBox.Name = "HexBox"
  173. HexBox.Parent = ColorPicker
  174. HexBox.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
  175. HexBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
  176. HexBox.Position = UDim2.new(0.0470588282, 0, 0.697435915, 0)
  177. HexBox.Size = UDim2.new(0, 102, 0, 19)
  178. HexBox.ClearTextOnFocus = false
  179. HexBox.Font = Enum.Font.Gotham
  180. HexBox.Text = "#ffffff"
  181. HexBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  182. HexBox.TextSize = 14.000
  183. HexBox.TextWrapped = true
  184. HexBox.TextXAlignment = Enum.TextXAlignment.Left
  185. CopyHexButton.Name = "CopyHexButton"
  186. CopyHexButton.Parent = HexBox
  187. CopyHexButton.BackgroundTransparency = 1.000
  188. CopyHexButton.LayoutOrder = 4
  189. CopyHexButton.Position = UDim2.new(1.16666663, 0, -0.157894731, 0)
  190. CopyHexButton.Size = UDim2.new(0, 25, 0, 25)
  191. CopyHexButton.ZIndex = 2
  192. CopyHexButton.Image = "rbxassetid://3926307971"
  193. CopyHexButton.ImageColor3 = Color3.fromRGB(76, 10, 103)
  194. CopyHexButton.ImageRectOffset = Vector2.new(684, 404)
  195. CopyHexButton.ImageRectSize = Vector2.new(36, 36)
  196.  
  197. MaterialPicker.Name = "MaterialPicker"
  198. MaterialPicker.Parent = MainFrame
  199. MaterialPicker.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
  200. MaterialPicker.BorderSizePixel = 0
  201. MaterialPicker.Position = UDim2.new(1.04911077, 0, 0.506986022, 0)
  202. MaterialPicker.Size = UDim2.new(0, 170, 0, 195)
  203. MaterialPicker.Visible = false
  204. MaterialSearch.Name = "MaterialSearch"
  205. MaterialSearch.Parent = MaterialPicker
  206. MaterialSearch.BackgroundTransparency = 1.000
  207. MaterialSearch.LayoutOrder = 1
  208. MaterialSearch.Position = UDim2.new(0, 5, 0, 5)
  209. MaterialSearch.Size = UDim2.new(0, 25, 0, 25)
  210. MaterialSearch.ZIndex = 2
  211. MaterialSearch.Image = "rbxassetid://3926305904"
  212. MaterialSearch.ImageColor3 = Color3.fromRGB(158, 61, 207)
  213. MaterialSearch.ImageRectOffset = Vector2.new(964, 324)
  214. MaterialSearch.ImageRectSize = Vector2.new(36, 36)
  215. MaterialBox.Name = "MaterialBox"
  216. MaterialBox.Parent = MaterialSearch
  217. MaterialBox.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
  218. MaterialBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
  219. MaterialBox.Position = UDim2.new(1.23218131, 0, 0.170428157, 0)
  220. MaterialBox.Size = UDim2.new(0, 122, 0, 15)
  221. MaterialBox.ClearTextOnFocus = false
  222. MaterialBox.Font = Enum.Font.Gotham
  223. MaterialBox.Text = ""
  224. MaterialBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  225. MaterialBox.TextSize = 14.000
  226. MaterialBox.TextWrapped = true
  227. MaterialBox.TextXAlignment = Enum.TextXAlignment.Left
  228. MaterialContainer.Name = "MaterialContainer"
  229. MaterialContainer.Parent = MaterialPicker
  230. MaterialContainer.Active = true
  231. MaterialContainer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  232. MaterialContainer.BackgroundTransparency = 1.000
  233. MaterialContainer.BorderSizePixel = 0
  234. MaterialContainer.Position = UDim2.new(0.0764705911, 0, 0.205128208, 0)
  235. MaterialContainer.Size = UDim2.new(0, 144, 0, 114)
  236. MaterialListLayout.Name = "MaterialListLayout"
  237. MaterialListLayout.Parent = MaterialContainer
  238. MaterialListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  239. MaterialListLayout.Padding = UDim.new(0, 5)
  240. ExampleMaterial.Name = "ExampleMaterial"
  241. ExampleMaterial.Parent = MaterialContainer
  242. ExampleMaterial.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
  243. ExampleMaterial.BorderSizePixel = 0
  244. ExampleMaterial.Size = UDim2.new(0, 128, 0, 20)
  245. ExampleMaterial.AutoButtonColor = false
  246. ExampleMaterial.Font = Enum.Font.Gotham
  247. ExampleMaterial.Text = ""
  248. ExampleMaterial.TextColor3 = Color3.fromRGB(0, 0, 0)
  249. ExampleMaterial.TextSize = 14.000
  250. ExampleMaterial.Visible = false
  251. ExampleMatCorner.Name = "ExampleMatCorner"
  252. ExampleMatCorner.Parent = ExampleMaterial
  253. MaterialPickerCorner.Name = "MaterialPickerCorner"
  254. MaterialPickerCorner.Parent = MaterialPicker
  255. CurrentMaterialLabel.Name = "CurrentMaterialLabel"
  256. CurrentMaterialLabel.Parent = MaterialPicker
  257. CurrentMaterialLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  258. CurrentMaterialLabel.BackgroundTransparency = 1.000
  259. CurrentMaterialLabel.Position = UDim2.new(0, 0, 0.835897446, 0)
  260. CurrentMaterialLabel.Size = UDim2.new(0, 170, 0, 23)
  261. CurrentMaterialLabel.Font = Enum.Font.Gotham
  262. CurrentMaterialLabel.Text = "Current : "
  263. CurrentMaterialLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  264. CurrentMaterialLabel.TextSize = 14.000
  265. PartViewer.Name = "PartViewer"
  266. PartViewer.Parent = MainFrame
  267. PartViewer.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
  268. PartViewer.BorderSizePixel = 0
  269. PartViewer.Position = UDim2.new(1.7502178, 0, 0.305389225, 0)
  270. PartViewer.Size = UDim2.new(0, 170, 0, 195)
  271. PartViewer.Visible = false
  272. ViewerCorner.Name = "ViewerCorner"
  273. ViewerCorner.Parent = PartViewer
  274. MainViewer.BackgroundTransparency = 1.000
  275. MainViewer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  276. MainViewer.Name = "MainViewer"
  277. MainViewer.Parent = PartViewer
  278. MainViewer.Position = UDim2.new(0.052941177, 0, 0.102564104, 0)
  279. MainViewer.Size = UDim2.new(0,151,0,151)
  280. ConfigBox.Name = "ConfigBox"
  281. ConfigBox.Parent = MainFrame
  282. ConfigBox.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
  283. ConfigBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
  284. ConfigBox.Position = UDim2.new(0.032181263, 0, 0.916456103, 0)
  285. ConfigBox.Size = UDim2.new(0, 122, 0, 15)
  286. ConfigBox.ClearTextOnFocus = false
  287. ConfigBox.Font = Enum.Font.Gotham
  288. ConfigBox.Text = ""
  289. ConfigBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  290. ConfigBox.TextSize = 14.000
  291. ConfigBox.TextWrapped = true
  292. ConfigBox.TextXAlignment = Enum.TextXAlignment.Left
  293. SaveButton.Name = "SaveButton"
  294. SaveButton.Parent = ConfigBox
  295. SaveButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  296. SaveButton.BackgroundTransparency = 1.000
  297. SaveButton.Position = UDim2.new(0.991803765, 0, 7.30156898e-07, 0)
  298. SaveButton.Size = UDim2.new(0, 66, 0, 17)
  299. SaveButton.AutoButtonColor = false
  300. SaveButton.Font = Enum.Font.Gotham
  301. SaveButton.Text = "Save"
  302. SaveButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  303. SaveButton.TextSize = 20.000
  304. ConfigDownload.Name = "ConfigDownload"
  305. ConfigDownload.Parent = SaveButton
  306. ConfigDownload.BackgroundTransparency = 1.000
  307. ConfigDownload.LayoutOrder = 5
  308. ConfigDownload.Position = UDim2.new(0.807501316, 0, -0.235294119, 0)
  309. ConfigDownload.Size = UDim2.new(0, 25, 0, 25)
  310. ConfigDownload.ZIndex = 2
  311. ConfigDownload.Image = "rbxassetid://3926305904"
  312. ConfigDownload.ImageColor3 = Color3.fromRGB(76, 10, 103)
  313. ConfigDownload.ImageRectOffset = Vector2.new(844, 444)
  314. ConfigDownload.ImageRectSize = Vector2.new(36, 36)
  315. LoadButton.Name = "SaveButton"
  316. LoadButton.Parent = ConfigBox
  317. LoadButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  318. LoadButton.BackgroundTransparency = 1.000
  319. LoadButton.Position = UDim2.new(0.991803765, 0, 1.40000057, 0)
  320. LoadButton.Size = UDim2.new(0, 66, 0, 17)
  321. LoadButton.AutoButtonColor = false
  322. LoadButton.Font = Enum.Font.Gotham
  323. LoadButton.Text = "Load"
  324. LoadButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  325. LoadButton.TextSize = 20.000
  326. ConfigLoad.Name = "ConfigLoad"
  327. ConfigLoad.Parent = LoadButton
  328. ConfigLoad.BackgroundTransparency = 1.000
  329. ConfigLoad.LayoutOrder = 5
  330. ConfigLoad.Position = UDim2.new(0.808000028, 0, -0.234999999, 0)
  331. ConfigLoad.Size = UDim2.new(0, 25, 0, 25)
  332. ConfigLoad.ZIndex = 2
  333. ConfigLoad.Image = "rbxassetid://3926305904"
  334. ConfigLoad.ImageColor3 = Color3.fromRGB(76, 10, 103)
  335. ConfigLoad.ImageRectOffset = Vector2.new(404, 444)
  336. ConfigLoad.ImageRectSize = Vector2.new(36, 36)
  337. DeleteButton.Name = "DeleteButton"
  338. DeleteButton.Parent = ConfigBox
  339. DeleteButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  340. DeleteButton.BackgroundTransparency = 1.000
  341. DeleteButton.Position = UDim2.new(1.60655785, 0, -0.13333261, 0)
  342. DeleteButton.Size = UDim2.new(0, 66, 0, 17)
  343. DeleteButton.AutoButtonColor = false
  344. DeleteButton.Font = Enum.Font.Gotham
  345. DeleteButton.Text = "Delete"
  346. DeleteButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  347. DeleteButton.TextSize = 20.000
  348. ConfigDelete.Name = "ConfigDelete"
  349. ConfigDelete.Parent = DeleteButton
  350. ConfigDelete.BackgroundTransparency = 1.000
  351. ConfigDelete.LayoutOrder = 4
  352. ConfigDelete.Position = UDim2.new(0.303030312, 0, 1.11764705, 0)
  353. ConfigDelete.Size = UDim2.new(0, 25, 0, 25)
  354. ConfigDelete.ZIndex = 2
  355. ConfigDelete.Image = "rbxassetid://3926305904"
  356. ConfigDelete.ImageColor3 = Color3.fromRGB(255, 0, 0)
  357. ConfigDelete.ImageRectOffset = Vector2.new(924, 724)
  358. ConfigDelete.ImageRectSize = Vector2.new(36, 36)
  359. VersionLabel.Name = "VersionLabel"
  360. VersionLabel.Parent = MainFrame
  361. VersionLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  362. VersionLabel.BackgroundTransparency = 1.000
  363. VersionLabel.Position = UDim2.new(0, 0, 0.958083808, 0)
  364. VersionLabel.Size = UDim2.new(0, 69, 0, 17)
  365. VersionLabel.Font = Enum.Font.Kalam
  366. VersionLabel.Text = "v~1.0"
  367. VersionLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  368. VersionLabel.TextSize = 30.000
  369. --
  370. local client = game.Players.LocalPlayer
  371. local mouse = client:GetMouse()
  372. local camera = workspace.CurrentCamera
  373. local rs = game:GetService("RunService")
  374. local uis = game:GetService("UserInputService")
  375. local ts = game:GetService("TweenService")
  376.  
  377. local currentPart = nil
  378. local draggingColors = false
  379. local draggingValue = false
  380. local currentColor = nil
  381. local currentUi = nil
  382. local fakePart = nil
  383. local lastHex = ""
  384. local gunList = {}
  385. local colorCounter = 0
  386. local rH,rS,rV
  387.  
  388. local viewportCamera = Instance.new("Camera")
  389. MainViewer.CurrentCamera = viewportCamera
  390. viewportCamera.Parent = MainViewer
  391.  
  392. for i,v in pairs(Enum.Material:GetEnumItems()) do
  393.    local newMat = ExampleMaterial:Clone()
  394.    newMat.Parent = MaterialContainer
  395.    newMat.Text = v.Name
  396.    newMat.Visible = true
  397.    newMat.MouseButton1Click:connect(function()
  398.        currentPart.Material = v    
  399.        CurrentMaterialLabel.Text = "Current : "..currentPart.Material.Name
  400.    end)
  401. end
  402. MaterialContainer.CanvasSize = UDim2.new(0,0,0,MaterialListLayout.AbsoluteContentSize.Y)
  403. local function to_hex(color)
  404.    return string.format("#%02X%02X%02X", color.R * 0xFF,color.G * 0xFF, color.B * 0xFF)
  405. end
  406. local function popParts()
  407.    currentGun = workspace.MenuLobby.GunStage.GunModel:GetChildren()[1]
  408.    local newGun = true
  409.    if gunList[currentGun.Name] then newGun = false else gunList[currentGun.Name] = {} end
  410.    for i,v in ipairs(PartContainer:GetChildren()) do
  411.        if v ~= PartListLayout and v ~= ExamplePart then
  412.            v:Destroy()
  413.        end
  414.    end
  415.    local e = currentGun:GetChildren()
  416.    table.remove(e,1)
  417.    for i,part in ipairs(e) do
  418.        if part.ClassName == "MeshPart" or part.ClassName == "Part" or part.ClassName == "UnionOperation" then
  419.            if fakePart then fakePart:Destroy() end
  420.            if newGun then
  421.                local listPart = {Color=nil,Material=nil}
  422.                listPart.Color = part.Color
  423.                listPart.Material = part.Material
  424.                gunList[currentGun.Name][i] = listPart
  425.            end
  426.            part.Color = gunList[currentGun.Name][i].Color
  427.            part.Material = gunList[currentGun.Name][i].Material
  428.            local old
  429.            old = hookmetamethod(game, "__newindex", function(self, index,value)
  430.                if checkcaller() and self == part and index == "Color" then
  431.                    gunList[currentGun.Name][i].Color = value
  432.                    return old(self, index,value)
  433.                elseif checkcaller() and self == part and index == "Material" then
  434.                    gunList[currentGun.Name][i].Material = value
  435.                    return old(self, index,value)
  436.                end
  437.                return old(self, index,value)
  438.            end)
  439.            
  440.            fakePart = part:Clone()
  441.            fakePart.Parent = MainViewer
  442.            fakePart.Position = Vector3.new(0, 0, 0)
  443.            viewportCamera.CFrame = CFrame.new(Vector3.new(3, 0, 0), fakePart.Position)
  444.            local h,s,v = part.Color:ToHSV()
  445.            local newPart = ExamplePart:Clone()
  446.            wait()
  447.            newPart.Parent = ExamplePart.Parent
  448.            newPart.Text = " "..part.Name.." | "..tostring(i)
  449.            newPart.Visible = true
  450.            repeat wait() until newPart:FindFirstChild("CPButton")
  451.            newPart.CPButton.BackgroundColor3 = Color3.fromHSV(h,s,v)
  452.            newPart.MouseButton1Click:connect(function()
  453.                if fakePart then fakePart:Destroy() end
  454.                fakePart = part:Clone()
  455.                fakePart.Parent = MainViewer
  456.                fakePart.Position = Vector3.new(0, 0, 0)
  457.                currentColor = part.Color
  458.                currentPart = part
  459.                local h,s,v = part.Color:ToHSV()
  460.                ColorPicker.Visible = true
  461.                PartViewer.Visible = true
  462.                MaterialPicker.Visible = true
  463.                ColorPoint.Position = UDim2.new(1-h,-5,1-s,0)
  464.                BrightPoint.Position = UDim2.new(0.5,-3,1-v,0)
  465.                ColorPoint.BackgroundColor3 = Color3.fromHSV(h,s,v)
  466.                BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,v)
  467.                local color = Color3.fromHSV(h,s,v)
  468.                HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
  469.                currentUi = newPart
  470.                CurrentMaterialLabel.Text = "Current : "..part.Material.Name
  471.            end)
  472.        end
  473.    end
  474.    PartContainer.CanvasSize = UDim2.new(0,0,0,PartListLayout.AbsoluteContentSize.Y)
  475. end
  476. ColorSelection.MouseButton1Down:connect(function()draggingColors=true end)
  477. ColorPoint.MouseButton1Down:connect(function()draggingColors=true end)
  478. BrightnessSelection.MouseButton1Down:connect(function()draggingValue=true end)
  479. BrightPoint.MouseButton1Down:connect(function()draggingValue=true end)
  480. uis.InputEnded:Connect(function(input)
  481.    if input.UserInputType == Enum.UserInputType.MouseButton1 then
  482.        draggingColors = false
  483.        draggingValue = false
  484.    end
  485. end)
  486.  
  487. rs.RenderStepped:connect(function()
  488.    rH,rS,rV = (Color3.fromHSV(zigzag(colorCounter),1,1)):ToHSV()
  489.    colorCounter = colorCounter + 0.01
  490.    if statText.Visible then
  491.        local mousePos = camera:WorldToViewportPoint(mouse.Hit.p)
  492.        statText.Position = Vector2.new(mousePos.X,mousePos.Y+20)    
  493.    end
  494.    if draggingColors and PFSkinEditor:IsDescendantOf(game.CoreGui) then
  495.        local relX = math.clamp(mouse.X - ColorSelection.AbsolutePosition.X,0,ColorSelection.AbsoluteSize.X)
  496.        local relY = math.clamp(mouse.Y - ColorSelection.AbsolutePosition.Y,0,ColorSelection.AbsoluteSize.Y)
  497.        local newH = relX/ColorSelection.AbsoluteSize.X
  498.        local newS = relY/ColorSelection.AbsoluteSize.Y
  499.        local _,_,newV = currentColor:ToHSV()
  500.        ColorPoint.Position = UDim2.new(newH,-2.5,newS,-2.5)
  501.        local color = Color3.fromHSV(1-newH,1-newS,newV)
  502.        ColorPoint.BackgroundColor3 = color
  503.        currentPart.Color = color
  504.        repeat wait() until currentUi:FindFirstChild("CPButton")
  505.        currentUi.CPButton.BackgroundColor3 = color
  506.        if fakePart then fakePart.Color = color end
  507.        local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  508.        HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
  509.        currentColor = color
  510.        lastHex = HexBox.Text
  511.    end
  512.    if draggingValue and PFSkinEditor:IsDescendantOf(game.CoreGui) then
  513.        local relY = math.clamp(mouse.Y - BrightnessSelection.AbsolutePosition.Y,0,BrightnessSelection.AbsoluteSize.Y)
  514.        BrightPoint.Position = UDim2.new(0.5,-3,0,relY-2.5)
  515.        local newH,newS,_ = currentColor:ToHSV()  
  516.        local newV = 1-(relY/BrightnessSelection.AbsoluteSize.Y)
  517.        local color = Color3.fromHSV(newH,newS,newV)
  518.        ColorPoint.BackgroundColor3 = color
  519.        BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,newV)
  520.        currentColor = color
  521.        currentPart.Color = color
  522.        repeat wait() until currentUi:FindFirstChild("CPButton")
  523.        currentUi.CPButton.BackgroundColor3 = color
  524.        if fakePart then fakePart.Color = color end
  525.        local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  526.        HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
  527.        lastHex = HexBox.Text
  528.    end
  529. end)
  530. HexBox.Focused:Connect(function()lastHex = HexBox.Text end)
  531. HexBox.FocusLost:connect(function()
  532.    if not pcall(function()
  533.        local hex = HexBox.Text
  534.        local r, g, b = string.match(hex, "^#?(%w%w)(%w%w)(%w%w)$")
  535.        local h,s,v =  Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16)):ToHSV()
  536.        local color = Color3.fromHSV(h,s,v)
  537.        currentColor = color
  538.        currentPart.Color = color
  539.        ColorPoint.BackgroundColor3 = color
  540.        BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,v)
  541.        currentUi.CPButton.BackgroundColor3 = color
  542.        ColorPoint.Position = UDim2.new(1-h,0,1-s,0)
  543.        BrightPoint.Position = UDim2.new(0.5,-3,1-v,0)
  544.        if fakePart then fakePart.Color = color end
  545.    end)
  546.    then
  547.        HexBox.Text = lastHex
  548.    end
  549. end)
  550. popParts()
  551. workspace.ChildRemoved:connect(function(x)if x.Name == "MenuLobby" then MainFrame.Visible = false end end)
  552. workspace.ChildAdded:connect(function(x)if x.Name == "MenuLobby" then MainFrame.Visible = true end end)
  553. workspace.MenuLobby.GunStage.GunModel.ChildAdded:connect(function(x)
  554.    MainTitle.Text = "Skin Editor : "..x.Name
  555.    currentGun = x
  556.    wait(.1)
  557.    popParts()
  558. end)
  559. MaterialBox:GetPropertyChangedSignal("Text"):connect(function()
  560.    local search = MaterialBox.Text
  561.    for i,v in ipairs(MaterialContainer:GetChildren()) do
  562.        if v ~= MaterialListLayout and v ~= ExampleMaterial then
  563.            if v.Text:sub(1,#search):lower() == search:lower() then
  564.                v.Visible = true
  565.            else
  566.                v.Visible = false
  567.            end
  568.        end
  569.    end
  570.    MaterialContainer.CanvasSize = UDim2.new(0,0,0,MaterialListLayout.AbsoluteContentSize.Y)
  571. end)
  572. SaveButton.MouseButton1Click:connect(function()
  573.    local stringList = ""
  574.    for i,v in pairs(gunList) do
  575.        stringList = stringList..',["'..i..'"] = {'
  576.        for _,part in pairs(v) do
  577.            local h,s,v = part.Color:ToHSV()
  578.            stringList = stringList.."{Color=Color3.fromHSV("..tostring(h)..','..tostring(s)..','..tostring(v).."),Material=Enum.Material."..part.Material.Name.."},"
  579.        end
  580.        stringList = stringList:sub(1,#stringList-1)..'},'
  581.    end
  582.    stringList = "return {"..stringList:sub(2,#stringList-1)..'}'
  583.    setclipboard(stringList)
  584.    writefile("PFSkins/"..ConfigBox.Text..".lua",stringList)  
  585.    say("Saved to PFSkins/"..ConfigBox.Text..".lua")
  586. end)
  587. DeleteButton.MouseButton1Click:connect(function()
  588.    if isfile("PFSkins/"..ConfigBox.Text..".lua") then
  589.        delfile("PFSkins/"..ConfigBox.Text..".lua")
  590.        say("Deleted PFSkins/"..ConfigBox.Text..".lua")
  591.    else
  592.        say("File Error : PFSkins/"..ConfigBox.Text..".lua")
  593.    end
  594. end)
  595. CopyHexButton.MouseButton1Click:connect(function()
  596.    setclipboard(HexBox.Text)
  597.    say("Copied hex to clipboard")
  598. end)
  599. LoadButton.MouseButton1Click:connect(function()
  600.    if isfile("PFSkins/"..ConfigBox.Text..".lua") then
  601.        gunList = loadstring(readfile("PFSkins/"..ConfigBox.Text..".lua"))()
  602.        popParts()
  603.        say("Loaded from PFSkins/"..ConfigBox.Text..".lua")
  604.    else
  605.        say("File Error : PFSkins/"..ConfigBox.Text..".lua")    
  606.    end
  607. end)
  608.  
  609. camera.ChildAdded:connect(function(x)
  610.    wait()
  611.    if not x:FindFirstChild("Trigger") then return end
  612.    if gunList[x.Name] then
  613.        actGun = x
  614.        for i,part in ipairs(x:GetChildren()) do
  615.            if part.ClassName == "MeshPart" or part.ClassName == "Part" or part.ClassName == "UnionOperation" then
  616.                if gunList[x.Name][i].Color then
  617.                    part.Color = gunList[x.Name][i].Color
  618.                end
  619.                if gunList[x.Name][i].Material then
  620.                    part.Material = gunList[x.Name][i].Material
  621.                end
  622.            end
  623.        end
  624.    end
  625. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement