Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Made by Nij55 #9484
- JCFs stands for James' Custom Functions]]
- -- Variables
- local ObjectElements = {Storage = {}, Templates = {}}
- local EntryStorage = {}
- local JCFs = {Enabled = true, Version = '0.0.3'}
- local Colors = {Foreground = Color3.fromRGB(32,32,32),
- Background = Color3.fromRGB(22,22,22),
- Button = Color3.fromRGB(47,47,47),
- TextBox = Color3.fromRGB(18,18,18),
- Text1 = Color3.new(1,1,1),
- Accent = Color3.fromRGB(227,0,140),
- TextSelect = Color3.fromRGB(153,153,153)}
- -- Services
- local Services = setmetatable({}, {
- __index = function(self,Index)
- if pcall(function() game:GetService(Index) end) then
- return game:GetService(Index)
- else
- return
- end
- end
- })
- -- New Object
- function New(Object,ObjectProperties,Third)
- if not JCFs.Enabled then return end
- if type(Object) == 'string' and type(ObjectProperties) == 'table' then
- 11111111111111111111111111 if Object:sub(1,3) == 'Dj-' then
- for FuncName, Function in pairs(ObjectElements.Templates) do
- if Object:sub(4) == FuncName then return Function(ObjectProperties,Third) end
- end
- else
- local CreatedInstance = Instance.new(Object)
- for Prop,PropVal in pairs(ObjectProperties) do
- CreatedInstance[Prop] = PropVal
- end
- return CreatedInstance
- end
- end
- end
- -- Pre Configuration & Variables
- local Mode = 'Compatible'
- local DjangoHolder
- local SynapseBeta
- local KrnlLoaded
- local LocalPlayer = Services.Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- pcall(function() SynapseBeta = syn.is_beta() end)
- pcall(function() KrnlLoaded = KRNL_LOADED end)
- if Services.RunService:IsStudio() then
- Mode = 'Studio'
- elseif KrnlLoaded == true or KrnlLoaded == false then
- print("Django - You're using Krnl.")
- Mode = 'Advanced'
- elseif SynapseBeta == true or SynapseBeta == false then
- print("Django - You're using Synapse.")
- Mode = 'Advanced'
- end
- if Mode == 'Advanced' then
- Services.CoreGui.RobloxPromptGui.ResetOnSpawn = false
- Services.CoreGui.RobloxPromptGui.IgnoreGuiInset = true
- end
- -- UI Configuration
- if Mode == 'Compatible' or Mode == 'Studio' then
- DjangoHolder = New('ScreenGui',{Parent = LocalPlayer.PlayerGui, Name = 'Django Main', DisplayOrder = 2147483647, ZIndexBehavior = Enum.ZIndexBehavior.Global, ResetOnSpawn = false, IgnoreGuiInset = true})
- elseif Mode == 'Advanced' then
- DjangoHolder = New('Folder',{Parent = Services.CoreGui.RobloxPromptGui, Name = 'Django Main'})
- Services.CoreGui.RobloxPromptGui.ResetOnSpawn = false
- Services.CoreGui.RobloxPromptGui.IgnoreGuiInset = true
- end
- -- Color Stuff
- function JCFs.RefreshColors()
- if not JCFs.Enabled then return end
- for ObjectName, Object in pairs(ObjectElements.Storage) do
- for ObjectProperty, Color in pairs(Object.Colors) do
- Object.Instance[ObjectProperty] = Colors[Color]
- end
- end
- end
- -- Scale Text
- function JCFs.ScaleText(TextInst,Size)
- if not JCFs.Enabled then return end
- TextInst:GetPropertyChangedSignal('AbsoluteSize'):Connect(function()
- if not JCFs.Enabled then return end
- TextInst.TextScaled = false
- TextInst.TextSize = math.ceil(TextInst.AbsoluteSize.Y * Size)
- if TextInst.TextFits then
- TextInst.TextScaled = false
- else
- TextInst.TextScaled = true
- end
- end)
- TextInst.TextSize = math.ceil(TextInst.AbsoluteSize.Y * Size)
- if TextInst.TextFits then
- TextInst.TextScaled = false
- else
- TextInst.TextScaled = true
- end
- end
- -- Log
- function JCFs.Log(NewObject)
- if not JCFs.Enabled then return end
- ObjectElements.Storage[NewObject.Instance.Name] = NewObject
- end
- -- Key Gen
- function JCFs.KeyGen(Length,NumbersEnabled,SpecialsEnabled,CapsEnabled)
- if not JCFs.Enabled then return end
- local Letters = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
- local Specials = {"!","@","#","$","%","^","&","*","(",")","_","-","=","+","[","]","{","}",";",":","'","",",",".","?","<",">","/","|","`","~","\""}
- local GeneratedString = ""
- local FullArray = {}
- if Length < 0 then
- return GeneratedString
- end
- local SiftedAmount = 0
- for i, v in pairs(Letters) do
- table.insert(FullArray,v)
- end
- if CapsEnabled then
- for i, v in pairs(Letters) do
- table.insert(FullArray,string.upper(v))
- end
- end
- if SpecialsEnabled then
- for i, v in pairs(Specials) do
- table.insert(FullArray,v)
- end
- end
- if NumbersEnabled then
- table.insert(FullArray,0)
- local NumbersAdded = 0
- while NumbersAdded > 9 do
- table.insert(FullArray,NumbersAdded +1)
- end
- end
- while SiftedAmount < Length do
- local SelectedChar = math.random(1,#FullArray)
- GeneratedString = GeneratedString..FullArray[SelectedChar]
- SiftedAmount = SiftedAmount +1
- end
- return GeneratedString
- end
- -- Draggable
- function JCFs.EnableDrag(FrameMove,FrameDrag)
- if not JCFs.Enabled then return end
- local FrameDragging = false
- local FrameDragStartPoint = nil
- local FrameStartPoint = nil
- Mouse.Button1Up:Connect(function()
- FrameDragging = false
- end)
- Mouse.Move:Connect(function()
- if FrameDragging and JCFs.Enabled then
- local Delta = FrameDragStartPoint - Vector2.new(Mouse.X,Mouse.Y)
- FrameMove.Instance:TweenPosition(UDim2.new(FrameStartPoint.X.Scale,FrameStartPoint.X.Offset - Delta.X,FrameStartPoint.Y.Scale,FrameStartPoint.Y.Offset - Delta.Y),'InOut','Bounce',0.1,true)
- end
- end)
- FrameDrag.Instance.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- FrameDragging = true
- FrameStartPoint = FrameMove.Instance.Position
- FrameDragStartPoint = Vector2.new(Mouse.X,Mouse.Y)
- end
- end)
- FrameDrag.Instance.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- FrameDragging = false
- end
- end)
- end
- -- Remove Function
- function JCFs.Remove(Object)
- Object.Instance:Destroy()
- ObjectElements.Storage[Object] = nil
- end
- -- Print Objects
- function JCFs.PrintObjects()
- for Pos,Obj in pairs(ObjectElements.Storage) do
- print(Obj.Instance.Name)
- end
- end
- -- Exit Function
- function JCFs.Exit()
- JCFs.Enabled = false
- DjangoHolder:Destroy()
- script:Destroy() -- May work sometimes
- end
- -- Template Function - TextLabel
- function ObjectElements.Templates.TextLabel(ObjectProperties)
- local NewObject = {Colors = {TextColor3 = 'Text1'}, Instance = New('TextLabel', {BackgroundTransparency = 1, Text = 'Text', Font = Enum.Font.SourceSansBold})}
- local Name = 'DjangoObject'..JCFs.KeyGen(8,false,false,true)
- for Prop, PropVal in pairs(ObjectProperties) do
- if Prop == 'Name' then
- Name = PropVal
- elseif Prop == 'FixText' then
- JCFs.ScaleText(NewObject.Instance,PropVal)
- else
- NewObject.Instance[Prop] = PropVal
- end
- end
- NewObject.Instance.Name = Name
- JCFs.Log(NewObject)
- return NewObject
- end
- -- Template Function - Button
- function ObjectElements.Templates.Button(ObjectProperties)
- local NewObject = {Colors = {TextColor3 = 'Text1', BackgroundColor3 = 'Button', BorderColor3 = 'Text1'}, Instance = New('TextButton', {Font = 'SourceSansSemibold', BorderMode = 'Inset', BorderSizePixel = 1, AutoButtonColor = false})}
- local Name = 'DjangoObject'..JCFs.KeyGen(8,false,false,true)
- for Prop, PropVal in pairs(ObjectProperties) do
- if Prop == 'Name' then
- Name = PropVal
- elseif Prop == 'FixText' then
- JCFs.ScaleText(NewObject.Instance,PropVal)
- else
- NewObject.Instance[Prop] = PropVal
- end
- end
- NewObject.Instance.MouseEnter:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.ButtonHover
- end)
- NewObject.Instance.MouseLeave:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.Foreground
- end)
- NewObject.Instance.MouseButton1Down:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.ButtonSelect
- end)
- NewObject.Instance.MouseButton1Up:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.ButtonHover
- end)
- NewObject.Instance.Name = Name
- JCFs.Log(NewObject)
- return NewObject
- end
- -- Template Function - Frame
- function ObjectElements.Templates.Frame(ObjectProperties)
- local NewObject = {Colors = {BackgroundColor3 = 'Foreground'}, Instance = New('Frame', {BorderSizePixel = 0})}
- local Name = 'DjangoObject'..JCFs.KeyGen(8,false,false,true)
- for Prop, PropVal in pairs(ObjectProperties) do
- if Prop == 'Name' then
- Name = PropVal
- elseif Prop == 'Color' then
- NewObject.Colors.BackgroundColor3 = PropVal
- else
- NewObject.Instance[Prop] = PropVal
- end
- end
- NewObject.Instance.Name = Name
- JCFs.Log(NewObject)
- return NewObject
- end
- -- Template Function - TextBox
- function ObjectElements.Templates.TextBox(ObjectProperties)
- local NewObject = {Colors = {BackgroundColor3 = 'TextBox', TextColor3 = 'Text1', BorderColor3 = 'TextSelect'}, Instance = New('TextBox', {Font = Enum.Font.SourceSansBold, BorderMode = 'Inset', BorderSizePixel = 1})}
- local Name = 'DjangoObject'..JCFs.KeyGen(8,false,false,true)
- local Text = 'Text'
- for Prop, PropVal in pairs(ObjectProperties) do
- if Prop == 'Name' then
- Name = PropVal
- elseif Prop == 'FixText' then
- JCFs.ScaleText(NewObject.Instance,PropVal)
- elseif Prop == 'Text' then
- HoldingText = PropVal
- else
- NewObject.Instance[Prop] = PropVal
- end
- end
- NewObject.Instance.Focused:Connect(function()
- NewObject.Instance.Text = ''
- NewObject.Instance.BorderColor3 = Colors.Accent
- end)
- NewObject.Instance.FocusLost:Connect(function()
- NewObject.Instance.Text = HoldingText
- NewObject.Instance.BorderColor3 = Colors.TextSelect
- end)
- NewObject.Instance.Text = HoldingText
- NewObject.Instance.Name = Name
- JCFs.Log(NewObject)
- return NewObject
- end
- -- Template Function - RibbonButton
- function ObjectElements.Templates.RibbonButton(ObjectProperties)
- NewObject = New('Dj-TextLabel', {Name = ObjectProperties.Name..'RibbonButton', Parent = ObjectElements.Storage.MFRibbon.Instance, ZIndex = 10003, LayoutOrder = 0, FixText = 0.9, Font = Enum.Font.SourceSansLight, BorderSizePixel = 0, Text = ObjectProperties.Name})
- for Prop, PropVal in pairs(ObjectProperties) do
- if Prop == 'Name' then
- else
- NewObject.Instance[Prop] = PropVal
- end
- end
- NewObject.Instance.Size = UDim2.new(0,Services.TextService:GetTextSize(ObjectProperties.Name,18,Enum.Font.SourceSansLight,Vector2.new(2147483647,20)).X +8,0,20)
- NewObject.Instance.MouseEnter:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.Background
- NewObject.Instance.BackgroundTransparency = 0.6
- end)
- NewObject.Instance.MouseLeave:Connect(function()
- NewObject.Instance.BackgroundColor3 = Colors.Background
- NewObject.Instance.BackgroundTransparency = 1
- end)
- NewObject.Instance.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- NewObject.Instance.BackgroundColor3 = Colors.Background
- NewObject.Instance.BackgroundTransparency = 0
- end
- end)
- NewObject.Instance.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- NewObject.Instance.BackgroundColor3 = Colors.Background
- NewObject.Instance.BackgroundTransparency = 0.6
- end
- end)
- return NewObject
- end
- -- Instances
- New('Dj-Frame',{Name = 'MainFrame', Parent = DjangoHolder, Size = UDim2.new(0,700,0,400), Position = UDim2.new(0.5,-350,0.5,-200), ZIndex = 10000, Color = 'Background'})
- New('Dj-Frame',{Name = 'MFTopBar', Parent = ObjectElements.Storage.MainFrame.Instance, Size = UDim2.new(1,0,0,45), ZIndex = 10001})
- New('Dj-TextLabel', {Name = 'MFTopBarLabel' , Parent = ObjectElements.Storage.MFTopBar.Instance, FixText = 0.7, Position = UDim2.new(0,44,0,5), Size = UDim2.new(1,-40,0,35), ZIndex = 10002, Text = 'Django version - '..JCFs.Version, Font = Enum.Font.SourceSans})
- JCFs.Log({Colors = {}, Instance = New('ImageLabel', {BackgroundTransparency = 1, Parent = ObjectElements.Storage.MFTopBar.Instance, Name = 'MFExitButton', ZIndex = 10003, Size = UDim2.new(0,13,0,13), Position = UDim2.new(1,-27,0,6), Image = 'http://www.roblox.com/asset/?id=5919834396'})})
- New('Dj-Frame',{Name = 'MFExitButtonBack', Parent = ObjectElements.Storage.MFTopBar.Instance, Size = UDim2.new(0,39,0,23), BackgroundTransparency = 1, ZIndex = 10002, Position = UDim2.new(1,-40,0,1), Color = 'Background'})
- JCFs.Log({Colors = {}, Instance = New('ImageLabel', {BackgroundTransparency = 1, Parent = ObjectElements.Storage.MFTopBar.Instance, Name = 'DjangoMFLogo', ZIndex = 10002, Size = UDim2.new(0,39,0,39), Position = UDim2.new(0,3,0,3), Image = 'http://www.roblox.com/asset/?id=5920047288'})})
- New('Dj-Frame',{Name = 'MFBottomBar', Parent = ObjectElements.Storage.MainFrame.Instance, Size = UDim2.new(1,0,0,35), Position = UDim2.new(0,0,1,-35), ZIndex = 10001})
- New('Dj-TextLabel', {Name = 'MFBottomBarLabel', Parent = ObjectElements.Storage.MFBottomBar.Instance, FixText = 0.8, Size = UDim2.new(1,0,1,0), ZIndex = 10002, Text = 'Press F8 to open and close.', Font = Enum.Font.SourceSans})
- New('Dj-Frame', {Name = 'MFRibbon', Parent = ObjectElements.Storage.MainFrame.Instance, ZIndex = 10001, Size = UDim2.new(1,0,0,20), Position = UDim2.new(0,0,0,45)})
- JCFs.Log({Colors = {}, Instance = New('UIListLayout', {Parent = ObjectElements.Storage.MFRibbon.Instance,Name = 'MFRibbonLayout', Padding = UDim.new(0,0), FillDirection = 'Horizontal', SortOrder = 'LayoutOrder'})})
- New('Dj-RibbonButton', {Name = 'Commands'})
- New('Dj-Frame', {Name = 'CommandsMenu', ZIndex = 10001, Parent = ObjectElements.Storage.MainFrame.Instance, Size = UDim2.new(1,0,0,300), Position = UDim2.new(0,0,0,65), Color = 'Background'})
- New('Dj-TextBox', {Name = 'CommandBar', Parent = ObjectElements.Storage.CommandsMenu.Instance, Size = UDim2.new(1,0,0,25), FixText = 0.65, Text = 'Click or press \\ to execute a command.', ZIndex = 10002, Font = Enum.Font.Ubuntu})
- -- Window Functions
- JCFs.EnableDrag(ObjectElements.Storage.MainFrame,ObjectElements.Storage.MFTopBar)
- ObjectElements.Storage.MFExitButtonBack.Instance.MouseEnter:Connect(function()
- ObjectElements.Storage.MFExitButtonBack.Instance.BackgroundTransparency = 0.6
- end)
- ObjectElements.Storage.MFExitButtonBack.Instance.MouseLeave:Connect(function()
- ObjectElements.Storage.MFExitButtonBack.Instance.BackgroundTransparency = 1
- end)
- ObjectElements.Storage.MFExitButtonBack.Instance.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- ObjectElements.Storage.MFExitButtonBack.Instance.BackgroundTransparency = 0
- end
- end)
- ObjectElements.Storage.MFExitButtonBack.Instance.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and JCFs.Enabled then
- ObjectElements.Storage.MFExitButtonBack.Instance.BackgroundTransparency = 0.6
- JCFs.Exit()
- end
- end)
- -- Key Functions
- Services.UserInputService.InputBegan:Connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.F8 then
- if ObjectElements.Storage.MainFrame.Instance.Visible then
- ObjectElements.Storage.MainFrame.Instance.Visible = false
- else
- ObjectElements.Storage.MainFrame.Instance.Visible = true
- end
- end
- end)
- -- Ending Stuff
- JCFs.RefreshColors()
- print('Django - Loaded successfully!')
Advertisement
Add Comment
Please, Sign In to add comment