Professional Documents
Culture Documents
PF
PF
MaterialPicker.Name = "MaterialPicker"
MaterialPicker.Parent = MainFrame
MaterialPicker.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
MaterialPicker.BorderSizePixel = 0
MaterialPicker.Position = UDim2.new(1.04911077, 0, 0.506986022, 0)
MaterialPicker.Size = UDim2.new(0, 170, 0, 195)
MaterialPicker.Visible = false
MaterialSearch.Name = "MaterialSearch"
MaterialSearch.Parent = MaterialPicker
MaterialSearch.BackgroundTransparency = 1.000
MaterialSearch.LayoutOrder = 1
MaterialSearch.Position = UDim2.new(0, 5, 0, 5)
MaterialSearch.Size = UDim2.new(0, 25, 0, 25)
MaterialSearch.ZIndex = 2
MaterialSearch.Image = "rbxassetid://3926305904"
MaterialSearch.ImageColor3 = Color3.fromRGB(158, 61, 207)
MaterialSearch.ImageRectOffset = Vector2.new(964, 324)
MaterialSearch.ImageRectSize = Vector2.new(36, 36)
MaterialBox.Name = "MaterialBox"
MaterialBox.Parent = MaterialSearch
MaterialBox.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
MaterialBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
MaterialBox.Position = UDim2.new(1.23218131, 0, 0.170428157, 0)
MaterialBox.Size = UDim2.new(0, 122, 0, 15)
MaterialBox.ClearTextOnFocus = false
MaterialBox.Font = Enum.Font.Gotham
MaterialBox.Text = ""
MaterialBox.TextColor3 = Color3.fromRGB(0, 0, 0)
MaterialBox.TextSize = 14.000
MaterialBox.TextWrapped = true
MaterialBox.TextXAlignment = Enum.TextXAlignment.Left
MaterialContainer.Name = "MaterialContainer"
MaterialContainer.Parent = MaterialPicker
MaterialContainer.Active = true
MaterialContainer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
MaterialContainer.BackgroundTransparency = 1.000
MaterialContainer.BorderSizePixel = 0
MaterialContainer.Position = UDim2.new(0.0764705911, 0, 0.205128208, 0)
MaterialContainer.Size = UDim2.new(0, 144, 0, 114)
MaterialListLayout.Name = "MaterialListLayout"
MaterialListLayout.Parent = MaterialContainer
MaterialListLayout.SortOrder = Enum.SortOrder.LayoutOrder
MaterialListLayout.Padding = UDim.new(0, 5)
ExampleMaterial.Name = "ExampleMaterial"
ExampleMaterial.Parent = MaterialContainer
ExampleMaterial.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
ExampleMaterial.BorderSizePixel = 0
ExampleMaterial.Size = UDim2.new(0, 128, 0, 20)
ExampleMaterial.AutoButtonColor = false
ExampleMaterial.Font = Enum.Font.Gotham
ExampleMaterial.Text = ""
ExampleMaterial.TextColor3 = Color3.fromRGB(0, 0, 0)
ExampleMaterial.TextSize = 14.000
ExampleMaterial.Visible = false
ExampleMatCorner.Name = "ExampleMatCorner"
ExampleMatCorner.Parent = ExampleMaterial
MaterialPickerCorner.Name = "MaterialPickerCorner"
MaterialPickerCorner.Parent = MaterialPicker
CurrentMaterialLabel.Name = "CurrentMaterialLabel"
CurrentMaterialLabel.Parent = MaterialPicker
CurrentMaterialLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
CurrentMaterialLabel.BackgroundTransparency = 1.000
CurrentMaterialLabel.Position = UDim2.new(0, 0, 0.835897446, 0)
CurrentMaterialLabel.Size = UDim2.new(0, 170, 0, 23)
CurrentMaterialLabel.Font = Enum.Font.Gotham
CurrentMaterialLabel.Text = "Current : "
CurrentMaterialLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
CurrentMaterialLabel.TextSize = 14.000
PartViewer.Name = "PartViewer"
PartViewer.Parent = MainFrame
PartViewer.BackgroundColor3 = Color3.fromRGB(207, 140, 255)
PartViewer.BorderSizePixel = 0
PartViewer.Position = UDim2.new(1.7502178, 0, 0.305389225, 0)
PartViewer.Size = UDim2.new(0, 170, 0, 195)
PartViewer.Visible = false
ViewerCorner.Name = "ViewerCorner"
ViewerCorner.Parent = PartViewer
MainViewer.BackgroundTransparency = 1.000
MainViewer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
MainViewer.Name = "MainViewer"
MainViewer.Parent = PartViewer
MainViewer.Position = UDim2.new(0.052941177, 0, 0.102564104, 0)
MainViewer.Size = UDim2.new(0,151,0,151)
ConfigBox.Name = "ConfigBox"
ConfigBox.Parent = MainFrame
ConfigBox.BackgroundColor3 = Color3.fromRGB(158, 61, 207)
ConfigBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
ConfigBox.Position = UDim2.new(0.032181263, 0, 0.916456103, 0)
ConfigBox.Size = UDim2.new(0, 122, 0, 15)
ConfigBox.ClearTextOnFocus = false
ConfigBox.Font = Enum.Font.Gotham
ConfigBox.Text = ""
ConfigBox.TextColor3 = Color3.fromRGB(0, 0, 0)
ConfigBox.TextSize = 14.000
ConfigBox.TextWrapped = true
ConfigBox.TextXAlignment = Enum.TextXAlignment.Left
SaveButton.Name = "SaveButton"
SaveButton.Parent = ConfigBox
SaveButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
SaveButton.BackgroundTransparency = 1.000
SaveButton.Position = UDim2.new(0.991803765, 0, 7.30156898e-07, 0)
SaveButton.Size = UDim2.new(0, 66, 0, 17)
SaveButton.AutoButtonColor = false
SaveButton.Font = Enum.Font.Gotham
SaveButton.Text = "Save"
SaveButton.TextColor3 = Color3.fromRGB(0, 0, 0)
SaveButton.TextSize = 20.000
ConfigDownload.Name = "ConfigDownload"
ConfigDownload.Parent = SaveButton
ConfigDownload.BackgroundTransparency = 1.000
ConfigDownload.LayoutOrder = 5
ConfigDownload.Position = UDim2.new(0.807501316, 0, -0.235294119, 0)
ConfigDownload.Size = UDim2.new(0, 25, 0, 25)
ConfigDownload.ZIndex = 2
ConfigDownload.Image = "rbxassetid://3926305904"
ConfigDownload.ImageColor3 = Color3.fromRGB(76, 10, 103)
ConfigDownload.ImageRectOffset = Vector2.new(844, 444)
ConfigDownload.ImageRectSize = Vector2.new(36, 36)
LoadButton.Name = "SaveButton"
LoadButton.Parent = ConfigBox
LoadButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
LoadButton.BackgroundTransparency = 1.000
LoadButton.Position = UDim2.new(0.991803765, 0, 1.40000057, 0)
LoadButton.Size = UDim2.new(0, 66, 0, 17)
LoadButton.AutoButtonColor = false
LoadButton.Font = Enum.Font.Gotham
LoadButton.Text = "Load"
LoadButton.TextColor3 = Color3.fromRGB(0, 0, 0)
LoadButton.TextSize = 20.000
ConfigLoad.Name = "ConfigLoad"
ConfigLoad.Parent = LoadButton
ConfigLoad.BackgroundTransparency = 1.000
ConfigLoad.LayoutOrder = 5
ConfigLoad.Position = UDim2.new(0.808000028, 0, -0.234999999, 0)
ConfigLoad.Size = UDim2.new(0, 25, 0, 25)
ConfigLoad.ZIndex = 2
ConfigLoad.Image = "rbxassetid://3926305904"
ConfigLoad.ImageColor3 = Color3.fromRGB(76, 10, 103)
ConfigLoad.ImageRectOffset = Vector2.new(404, 444)
ConfigLoad.ImageRectSize = Vector2.new(36, 36)
DeleteButton.Name = "DeleteButton"
DeleteButton.Parent = ConfigBox
DeleteButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
DeleteButton.BackgroundTransparency = 1.000
DeleteButton.Position = UDim2.new(1.60655785, 0, -0.13333261, 0)
DeleteButton.Size = UDim2.new(0, 66, 0, 17)
DeleteButton.AutoButtonColor = false
DeleteButton.Font = Enum.Font.Gotham
DeleteButton.Text = "Delete"
DeleteButton.TextColor3 = Color3.fromRGB(0, 0, 0)
DeleteButton.TextSize = 20.000
ConfigDelete.Name = "ConfigDelete"
ConfigDelete.Parent = DeleteButton
ConfigDelete.BackgroundTransparency = 1.000
ConfigDelete.LayoutOrder = 4
ConfigDelete.Position = UDim2.new(0.303030312, 0, 1.11764705, 0)
ConfigDelete.Size = UDim2.new(0, 25, 0, 25)
ConfigDelete.ZIndex = 2
ConfigDelete.Image = "rbxassetid://3926305904"
ConfigDelete.ImageColor3 = Color3.fromRGB(255, 0, 0)
ConfigDelete.ImageRectOffset = Vector2.new(924, 724)
ConfigDelete.ImageRectSize = Vector2.new(36, 36)
VersionLabel.Name = "VersionLabel"
VersionLabel.Parent = MainFrame
VersionLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
VersionLabel.BackgroundTransparency = 1.000
VersionLabel.Position = UDim2.new(0, 0, 0.958083808, 0)
VersionLabel.Size = UDim2.new(0, 69, 0, 17)
VersionLabel.Font = Enum.Font.Kalam
VersionLabel.Text = "v~1.0"
VersionLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
VersionLabel.TextSize = 30.000
--
local client = game.Players.LocalPlayer
local mouse = client:GetMouse()
local camera = workspace.CurrentCamera
local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local ts = game:GetService("TweenService")
fakePart = part:Clone()
fakePart.Parent = MainViewer
fakePart.Position = Vector3.new(0, 0, 0)
viewportCamera.CFrame = CFrame.new(Vector3.new(3, 0, 0),
fakePart.Position)
local h,s,v = part.Color:ToHSV()
local newPart = ExamplePart:Clone()
wait()
newPart.Parent = ExamplePart.Parent
newPart.Text = " "..part.Name.." | "..tostring(i)
newPart.Visible = true
repeat wait() until newPart:FindFirstChild("CPButton")
newPart.CPButton.BackgroundColor3 = Color3.fromHSV(h,s,v)
newPart.MouseButton1Click:connect(function()
if fakePart then fakePart:Destroy() end
fakePart = part:Clone()
fakePart.Parent = MainViewer
fakePart.Position = Vector3.new(0, 0, 0)
currentColor = part.Color
currentPart = part
local h,s,v = part.Color:ToHSV()
ColorPicker.Visible = true
PartViewer.Visible = true
MaterialPicker.Visible = true
ColorPoint.Position = UDim2.new(1-h,-5,1-s,0)
BrightPoint.Position = UDim2.new(0.5,-3,1-v,0)
ColorPoint.BackgroundColor3 = Color3.fromHSV(h,s,v)
BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,v)
local color = Color3.fromHSV(h,s,v)
HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
currentUi = newPart
CurrentMaterialLabel.Text = "Current : "..part.Material.Name
end)
end
end
PartContainer.CanvasSize = UDim2.new(0,0,0,PartListLayout.AbsoluteContentSize.Y)
end
ColorSelection.MouseButton1Down:connect(function()draggingColors=true end)
ColorPoint.MouseButton1Down:connect(function()draggingColors=true end)
BrightnessSelection.MouseButton1Down:connect(function()draggingValue=true end)
BrightPoint.MouseButton1Down:connect(function()draggingValue=true end)
uis.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
draggingColors = false
draggingValue = false
end
end)
rs.RenderStepped:connect(function()
rH,rS,rV = (Color3.fromHSV(zigzag(colorCounter),1,1)):ToHSV()
colorCounter = colorCounter + 0.01
if statText.Visible then
local mousePos = camera:WorldToViewportPoint(mouse.Hit.p)
statText.Position = Vector2.new(mousePos.X,mousePos.Y+20)
end
if draggingColors and PFSkinEditor:IsDescendantOf(game.CoreGui) then
local relX = math.clamp(mouse.X -
ColorSelection.AbsolutePosition.X,0,ColorSelection.AbsoluteSize.X)
local relY = math.clamp(mouse.Y -
ColorSelection.AbsolutePosition.Y,0,ColorSelection.AbsoluteSize.Y)
local newH = relX/ColorSelection.AbsoluteSize.X
local newS = relY/ColorSelection.AbsoluteSize.Y
local _,_,newV = currentColor:ToHSV()
ColorPoint.Position = UDim2.new(newH,-2.5,newS,-2.5)
local color = Color3.fromHSV(1-newH,1-newS,newV)
ColorPoint.BackgroundColor3 = color
currentPart.Color = color
repeat wait() until currentUi:FindFirstChild("CPButton")
currentUi.CPButton.BackgroundColor3 = color
if fakePart then fakePart.Color = color end
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)
HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
currentColor = color
lastHex = HexBox.Text
end
if draggingValue and PFSkinEditor:IsDescendantOf(game.CoreGui) then
local relY = math.clamp(mouse.Y -
BrightnessSelection.AbsolutePosition.Y,0,BrightnessSelection.AbsoluteSize.Y)
BrightPoint.Position = UDim2.new(0.5,-3,0,relY-2.5)
local newH,newS,_ = currentColor:ToHSV()
local newV = 1-(relY/BrightnessSelection.AbsoluteSize.Y)
local color = Color3.fromHSV(newH,newS,newV)
ColorPoint.BackgroundColor3 = color
BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,newV)
currentColor = color
currentPart.Color = color
repeat wait() until currentUi:FindFirstChild("CPButton")
currentUi.CPButton.BackgroundColor3 = color
if fakePart then fakePart.Color = color end
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)
HexBox.Text = to_hex(Color3.fromRGB(r,g,b))
lastHex = HexBox.Text
end
end)
HexBox.Focused:Connect(function()lastHex = HexBox.Text end)
HexBox.FocusLost:connect(function()
if not pcall(function()
local hex = HexBox.Text
local r, g, b = string.match(hex, "^#?(%w%w)(%w%w)(%w%w)$")
local h,s,v = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b,
16)):ToHSV()
local color = Color3.fromHSV(h,s,v)
currentColor = color
currentPart.Color = color
ColorPoint.BackgroundColor3 = color
BrightPoint.BackgroundColor3 = Color3.fromHSV(0,0,v)
currentUi.CPButton.BackgroundColor3 = color
ColorPoint.Position = UDim2.new(1-h,0,1-s,0)
BrightPoint.Position = UDim2.new(0.5,-3,1-v,0)
if fakePart then fakePart.Color = color end
end)
then
HexBox.Text = lastHex
end
end)
popParts()
workspace.ChildRemoved:connect(function(x)if x.Name == "MenuLobby" then
MainFrame.Visible = false end end)
workspace.ChildAdded:connect(function(x)if x.Name == "MenuLobby" then
MainFrame.Visible = true end end)
workspace.MenuLobby.GunStage.GunModel.ChildAdded:connect(function(x)
MainTitle.Text = "Skin Editor : "..x.Name
currentGun = x
wait(.1)
popParts()
end)
MaterialBox:GetPropertyChangedSignal("Text"):connect(function()
local search = MaterialBox.Text
for i,v in ipairs(MaterialContainer:GetChildren()) do
if v ~= MaterialListLayout and v ~= ExampleMaterial then
if v.Text:sub(1,#search):lower() == search:lower() then
v.Visible = true
else
v.Visible = false
end
end
end
MaterialContainer.CanvasSize =
UDim2.new(0,0,0,MaterialListLayout.AbsoluteContentSize.Y)
end)
SaveButton.MouseButton1Click:connect(function()
local stringList = ""
for i,v in pairs(gunList) do
stringList = stringList..',["'..i..'"] = {'
for _,part in pairs(v) do
local h,s,v = part.Color:ToHSV()
stringList =
stringList.."{Color=Color3.fromHSV("..tostring(h)..','..tostring(s)..','..tostring(
v).."),Material=Enum.Material."..part.Material.Name.."},"
end
stringList = stringList:sub(1,#stringList-1)..'},'
end
stringList = "return {"..stringList:sub(2,#stringList-1)..'}'
setclipboard(stringList)
writefile("PFSkins/"..ConfigBox.Text..".lua",stringList)
say("Saved to PFSkins/"..ConfigBox.Text..".lua")
end)
DeleteButton.MouseButton1Click:connect(function()
if isfile("PFSkins/"..ConfigBox.Text..".lua") then
delfile("PFSkins/"..ConfigBox.Text..".lua")
say("Deleted PFSkins/"..ConfigBox.Text..".lua")
else
say("File Error : PFSkins/"..ConfigBox.Text..".lua")
end
end)
CopyHexButton.MouseButton1Click:connect(function()
setclipboard(HexBox.Text)
say("Copied hex to clipboard")
end)
LoadButton.MouseButton1Click:connect(function()
if isfile("PFSkins/"..ConfigBox.Text..".lua") then
gunList = loadstring(readfile("PFSkins/"..ConfigBox.Text..".lua"))()
popParts()
say("Loaded from PFSkins/"..ConfigBox.Text..".lua")
else
say("File Error : PFSkins/"..ConfigBox.Text..".lua")
end
end)
camera.ChildAdded:connect(function(x)
wait()
if not x:FindFirstChild("Trigger") then return end
if gunList[x.Name] then
actGun = x
for i,part in ipairs(x:GetChildren()) do
if part.ClassName == "MeshPart" or part.ClassName == "Part" or
part.ClassName == "UnionOperation" then
if gunList[x.Name][i].Color then
part.Color = gunList[x.Name][i].Color
end
if gunList[x.Name][i].Material then
part.Material = gunList[x.Name][i].Material
end
end
end
end
end)