Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Main Screen Gui
- local main = Instance.new("ScreenGui")
- main.Name = "Morphs"
- --Setting up the gui
- local bg = Instance.new("Frame", main)
- bg.Name = "MainFrame"
- bg.Size = UDim2.new(0,400,0,250)
- bg.Position = UDim2.new(0.5, -200, 0.5, -125)
- bg.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
- local catFrame = Instance.new("ScrollingFrame", bg)
- catFrame.Name = "CatScrollingFrame"
- catFrame.Size = UDim2.new(1,-20,1,-60)
- catFrame.Position = UDim2.new(0,10,0,50)
- catFrame.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
- catFrame.CanvasSize = UDim2.new(0,0,15,0)
- local Template = Instance.new("Frame", bg)
- Template.Name = "Template"
- Template.Size = UDim2.new(1,-10,0, 65)
- Template.Position = UDim2.new(0,0,0,0)
- Template.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
- Template.Visible = false
- local design = Instance.new("Frame", bg)
- design.Name = "design"
- design.Size = UDim2.new(1,0,0,1)
- design.Position = UDim2.new(0,0,0,0)
- design.BackgroundColor3 = Color3.fromRGB(255,255,255)
- local title = Instance.new("TextLabel", bg)
- title.Name = "Title"
- title.Text = "Morphs"
- title.Font = "SourceSansBold"
- title.Size = UDim2.new(1,0,0,40)
- title.BackgroundTransparency = 1
- title.TextColor3 = Color3.fromRGB(255,255,255)
- title.TextSize = 18
- title.TextXAlignment = "Center"
- title.TextYAlignment = "Center"
- local sf = Instance.new("ScrollingFrame", bg)
- sf.Name = "ScrollingFrame"
- sf.Position = UDim2.new(0,10,0,50)
- sf.Size = UDim2.new(1,-20,1,-60)
- sf.CanvasSize = UDim2.new(0,0,15,0)
- sf.BackgroundColor3 = Color3.fromRGB(31, 40, 45)
- sf.Visible = false
- sf.ZIndex = 1
- local sflayout = Instance.new("UIListLayout", sf)
- sflayout.FillDirection = "Vertical"
- sflayout.HorizontalAlignment = "Left"
- sflayout.SortOrder = "Name"
- sflayout.VerticalAlignment = "Top"
- sflayout.Padding = UDim.new(0,0)
- --UI Styles
- local catFrameLayout = Instance.new("UIListLayout", catFrame)
- catFrameLayout.Padding = UDim.new(0,0)
- catFrameLayout.FillDirection = "Vertical"
- catFrameLayout.HorizontalAlignment = "Left"
- catFrameLayout.SortOrder = "Name"
- catFrameLayout.VerticalAlignment = "Top"
- --Template Settings
- local button = Instance.new("TextButton", Template)
- button.Name = "TextButton"
- button.BackgroundTransparency = 1
- button.Size = UDim2.new(1,0,1,0)
- button.BackgroundColor3 = Color3.fromRGB(27, 42, 53)
- button.ZIndex = 3
- local imLab = Instance.new("ImageLabel", Template)
- imLab.Name = "ImageLabel"
- imLab.Size = UDim2.new(0,55,0,55)
- imLab.Position = UDim2.new(0,5,0.5,-27)
- imLab.ZIndex = 2
- imLab.Image = "rbxassetid://17767705"
- imLab.BackgroundTransparency = 1
- local lab1 = Instance.new("TextLabel", Template)
- lab1.Name = "ButtonName"
- lab1.Size = UDim2.new(1,-70,0,25)
- lab1.Position = UDim2.new(0,65,0,0)
- lab1.BackgroundTransparency = 1
- lab1.ZIndex = 2
- lab1.TextXAlignment = "Left"
- lab1.TextYAlignment = "Center"
- lab1.TextColor3 = Color3.fromRGB(255,255,255)
- --Extras
- local decal = Instance.new("Decal", bg)
- decal.Texture = "rbxassetid://429379228"
- --Open/Close Button
- local but2 = Instance.new("TextButton", main)
- but2.Name = "OpenClose"
- but2.Size = UDim2.new(0.037,0,0.021,0)
- but2.Position = UDim2.new(0.004,0,0.912,0)
- but2.Text = "Open"
- but2.BackgroundColor3 = Color3.fromRGB(136, 136, 136)
- but2.BackgroundTransparency = 0.5
- --Close Button
- local cat = Instance.new("Frame", bg)
- cat.Name = "Categories"
- cat.Size = UDim2.new(0,40,0,40)
- cat.Position = UDim2.new(1,0,0.32,-80)
- cat.ZIndex = 2
- cat.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
- local but = Instance.new("TextButton", cat)
- but.Name = "button"
- but.Size = UDim2.new(1,0,1,0)
- but.Position = UDim2.new(0,0,0,0)
- but.BackgroundTransparency = 1
- but.Text = ""
- button.ZIndex = 3
- local imlab1 = Instance.new("ImageLabel", cat)
- imlab1.Size = UDim2.new(1,-20,1,-20)
- imlab1.Position = UDim2.new(0,10,0,10)
- imlab1.BackgroundTransparency = 1
- imlab1.Image = "rbxassetid://713294902"
- imlab1.ZIndex = 2
- local des = Instance.new("Frame", cat)
- des.Name = "design"
- des.Size = UDim2.new(1,0,0,1)
- des.Position = UDim2.new(0,0,0,0)
- des.ZIndex = 5
- --Confirm
- local con = Instance.new("Frame", bg)
- con.Name = "Confirm"
- con.BackgroundColor3 = Color3.fromRGB(42, 55, 62)
- con.Position = UDim2.new(0.5,-200,0.5,-125)
- con.Size = UDim2.new(0,400,0,250)
- con.ZIndex = 2
- con.Visible = false
- local yes = Instance.new("TextButton", con)
- yes.Name = "Yes"
- yes.Position = UDim2.new(0.2,0,0.6,0)
- yes.Size = UDim2.new(0.2,0,0.15,0)
- yes.BackgroundColor3 = Color3.fromRGB(0, 166, 0)
- yes.Font = "SourceSansBold"
- yes.TextSize = 22
- yes.TextXAlignment = "Center"
- yes.TextYAlignment = "Center"
- yes.Text = "Yes"
- yes.TextColor3 = Color3.fromRGB(255,255,255)
- yes.ZIndex = 3
- local no = Instance.new("TextButton", con)
- no.Name = "No"
- no.Position = UDim2.new(0.6,0,0.6,0)
- no.Size = UDim2.new(0.2,0,0.15,0)
- no.BackgroundColor3 = Color3.fromRGB(166, 0, 0)
- no.Font = "SourceSansBold"
- no.TextSize = 22
- no.TextXAlignment = "Center"
- no.TextYAlignment = "Center"
- no.ZIndex = 3
- no.Text = "No"
- local title2 = Instance.new("TextLabel", con)
- title2.Name = "Title"
- title2.BackgroundTransparency = 1
- title2.Position = UDim2.new(0,0,0.2,0)
- title2.Size = UDim2.new(1,0,0,40)
- title2.Text = "Are you sure you want to put the morph on?"
- title2.TextSize = 18
- title2.TextXAlignment = "Center"
- title2.TextYAlignment = "Center"
- title2.ZIndex = 3
- --[[Below is the code just ignore it it is right from their morph scripts]]--
- local Player = game:GetService("Players").LocalPlayer
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local GUI = bg
- local Events = game.ReplicatedStorage:WaitForChild("Events")
- local DestroyEvent = Events:WaitForChild("DestroyEvent")
- function CalculateCategories()
- local ScrollingFrame = GUI:WaitForChild("CatScrollingFrame")
- local Template = GUI:FindFirstChild("Template")
- for _,v in pairs(ScrollingFrame:GetChildren()) do
- if v.Name ~= "UIListLayout" then v:Destroy() end
- end
- for i,v in pairs(ReplicatedStorage.Morphs:GetChildren()) do
- local Decal = v:FindFirstChild("Decal")
- local NewCategory = Template:Clone()
- NewCategory.Parent = ScrollingFrame
- NewCategory.ImageLabel.Image = Decal.Texture
- NewCategory.Name = v.Name
- NewCategory.ButtonName.Text = v.Name
- NewCategory.Visible = true
- local Button = NewCategory:FindFirstChild("TextButton")
- if Button then
- Button.MouseButton1Down:connect(function()
- ScrollingFrame.Visible = false
- local Category = v
- CalculateMorphs(Category)
- end)
- end
- end
- end
- function CalculateMorphs(Category)
- local ScrollingFrame = GUI:FindFirstChild("ScrollingFrame")
- local Template = GUI:FindFirstChild("Template")
- for _,v in pairs(ScrollingFrame:GetChildren()) do
- if v.Name ~= "UIListLayout" then v:Destroy() end
- end
- ScrollingFrame.Visible = true
- for i,v in pairs(Category:GetChildren()) do
- if v:IsA("Folder") then
- if v:FindFirstChild("PlayerName") then
- local PlayerName = v:FindFirstChild("PlayerName")
- GenerateButton(v, Template, ScrollingFrame)
- elseif v:FindFirstChild("Rank") then
- GenerateButton(v, Template, ScrollingFrame)
- elseif v:FindFirstChild("GroupID") then
- GenerateButton(v, Template, ScrollingFrame)
- end
- end
- end
- end
- function GenerateButton(v, Template, ScrollingFrame)
- local Decal = v.Parent:FindFirstChild("Decal")
- local NewButton = Template:Clone()
- if Decal then
- NewButton.ImageLabel.Image = Decal.Texture
- end
- NewButton.Parent = ScrollingFrame
- NewButton.Name = v.Name
- NewButton.ButtonName.Text = v.Name
- NewButton.Visible = true
- local Button = NewButton:FindFirstChild("TextButton")
- if Button then
- Button.MouseButton1Down:connect(function()
- sf.Visible = false
- con.Visible = true
- con.No.MouseButton1Click:connect(function()
- con.Visible = false
- sf.Visible = true
- end)
- yes.MouseButton1Click:connect(function()
- Events:WaitForChild("EquipMorph"):FireServer(v, main, _G.Key)
- bg.Visible = false
- sf.Visible = false
- con.Visible = false
- catFrame.Visible = true
- but2.Text = "Open"
- open = false
- end)
- end)
- end
- end
- but.MouseButton1Down:connect(function()
- sf.Visible = false
- catFrame.Visible = true
- end)
- local open = false
- but2.MouseButton1Down:connect(function()
- if open == true then
- open = false
- but2.Text = "Open"
- bg.Visible = false
- return
- elseif open == false then
- open = true
- but2.Text = "Close"
- bg.Visible = true
- return
- end
- wait(1)
- end)
- main.Parent = game:GetService("Players").LocalPlayer.PlayerGui
- bg.Visible = false
- --main.Parent = game:GetService("CoreGui")
- CalculateCategories()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement