Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Hairs = require(game.ReplicatedStorage.Catalog.Hair)
- local Shirts = require(game.ReplicatedStorage.Catalog.Shirts)
- local Face = require(game.ReplicatedStorage.Catalog.Faces)
- local Pants = require(game.ReplicatedStorage.Catalog.Pants)
- plr = game.Players.LocalPlayer
- char = plr.Character or plr.CharacterAdded:Wait()
- local Editor = plr.PlayerGui.AvatarEditor
- Frame = Editor.Background.ScrollFrame
- MSS = game:GetService("MarketplaceService")
- local function AddUiGridLayout()
- local Grid = script:WaitForChild("UIGridLayout")
- Grid = Grid:Clone()
- Grid.Parent = Frame
- end
- local function ClearNillClothes()
- for i,v in pairs(Frame:GetChildren()) do
- if v:IsA("ImageLabel") and v.ClothingImage.IsLoaded == false then
- v:Destroy()
- end
- end
- end
- Event = game.ReplicatedStorage.AvatarEvent
- char.Humanoid.Died:Connect(function()
- local Description = char.Humanoid:GetAccessories()
- Event:FireServer("Respawned",Description)
- end)
- local Camera = workspace.CurrentCamera
- Editor.Background.Hair.MouseButton1Click:Connect(function()
- Frame:ClearAllChildren()
- AddUiGridLayout()
- for i,v in pairs(Hairs) do
- local Asset = MSS:GetProductInfo(v.ID,Enum.InfoType.Asset)
- if Asset.IsForSale == false then
- warn("Deleted Asset")
- else
- Button = script:WaitForChild("Button"):Clone()
- Button.Parent = Frame
- Button:WaitForChild("ClothingImage").Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..v.ID.."&width=420&height=420&format=png"
- Button.Name = v.Name
- Button.ClothingImage.MouseButton1Click:Connect(function()
- Event:FireServer("Hair",v.ID)
- end)
- end
- end
- end)
- Editor.Background.Shirts.MouseButton1Click:Connect(function()
- Frame:ClearAllChildren()
- AddUiGridLayout()
- for i,v in pairs(Shirts) do
- local Asset = MSS:GetProductInfo(v.ID,Enum.InfoType.Asset)
- if Asset.IsForSale == false then
- warn("Deleted Asset")
- else
- Button = script:WaitForChild("Button"):Clone()
- Button.Parent = Frame
- Button:WaitForChild("ClothingImage").Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..v.ID.."&width=420&height=420&format=png"
- Button.Name = v.Name
- Button.ClothingImage.MouseButton1Click:Connect(function()
- Event:FireServer("Shirt",v.ID)
- end)
- end
- end
- end)
- Editor.Background.Face.MouseButton1Click:Connect(function()
- Frame:ClearAllChildren()
- AddUiGridLayout()
- for i,v in pairs(Face) do
- local Asset = MSS:GetProductInfo(v.ID,Enum.InfoType.Asset)
- if Asset.IsForSale == false then
- warn("Deleted Asset")
- else
- Button = script:WaitForChild("Button"):Clone()
- Button.Parent = Frame
- Button:WaitForChild("ClothingImage").Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..v.ID.."&width=420&height=420&format=png"
- Button.Name = v.Name
- Button.ClothingImage.MouseButton1Click:Connect(function()
- Event:FireServer("Face",v.ID)
- end)
- end
- end
- end)
- Editor.Background.Pants.MouseButton1Click:Connect(function()
- Frame:ClearAllChildren()
- AddUiGridLayout()
- for i,v in pairs(Pants) do
- local Asset = MSS:GetProductInfo(v.ID,Enum.InfoType.Asset)
- if Asset.IsForSale == false then
- warn("Deleted Asset")
- else
- Button = script:WaitForChild("Button"):Clone()
- Button.Parent = Frame
- Button:WaitForChild("ClothingImage").Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..v.ID.."&width=420&height=420&format=png"
- Button.Name = v.Name
- Button.ClothingImage.MouseButton1Click:Connect(function()
- Event:FireServer("Pants",v.ID)
- end)
- end
- end
- end)
- Editor.Background.CloseButton.MouseButton1Click:Connect(function()
- Editor.Background:TweenPosition(UDim2.new(0.181, 0,1.34, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear)
- wait(1)
- Editor.Background.Visible = false
- repeat wait ()
- Camera.CameraType = Enum.CameraType.Custom
- until Camera.CameraType == Enum.CameraType.Custom
- Camera.CameraSubject = char.Humanoid
- Camera.CameraSubject = char.Humanoid
- Camera.CameraType = "Custom"
- Camera.CFrame = char.Head.CFrame
- char.HumanoidRootPart.Anchored = false
- char.Humanoid.JumpPower = 16
- end)
- Editor.AvatarButton.MouseButton1Click:Connect(function()
- Editor.Background.Visible = true
- Editor.Background:TweenPosition(UDim2.new(0.194, 0,0.5, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear)
- Camera.Focus = CFrame.lookAt(char:WaitForChild("HumanoidRootPart").Position,Camera.CFrame.Position - Vector3.new(0,0,-5))
- Camera.CFrame = CFrame.lookAt(char:WaitForChild("HumanoidRootPart").Position,Camera.CFrame.Position - Vector3.new(0,0,-5))
- Camera.CameraSubject = char:WaitForChild("Head")
- char.HumanoidRootPart.Anchored = true
- char.Humanoid.JumpPower = 0
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement