Source.lua
Source.lua
local redzlib = {
Themes = {
Darker = {
["Color Hub 1"] = ColorSequence.new({
ColorSequenceKeypoint.new(0.00, Color3.fromRGB(25, 25,
25)),
ColorSequenceKeypoint.new(0.50, Color3.fromRGB(32.5, 32.5,
32.5)),
ColorSequenceKeypoint.new(1.00, Color3.fromRGB(25, 25, 25))
}),
["Color Hub 2"] = Color3.fromRGB(30, 30, 30),
["Color Stroke"] = Color3.fromRGB(40, 40, 40),
["Color Theme"] = Color3.fromRGB(88, 101, 242),
["Color Text"] = Color3.fromRGB(243, 243, 243),
["Color Dark Text"] = Color3.fromRGB(180, 180, 180)
},
Dark = {
["Color Hub 1"] = ColorSequence.new({
ColorSequenceKeypoint.new(0.00, Color3.fromRGB(40, 40,
40)),
ColorSequenceKeypoint.new(0.50, Color3.fromRGB(47.5, 47.5,
47.5)),
ColorSequenceKeypoint.new(1.00, Color3.fromRGB(40, 40, 40))
}),
["Color Hub 2"] = Color3.fromRGB(45, 45, 45),
["Color Stroke"] = Color3.fromRGB(65, 65, 65),
["Color Theme"] = Color3.fromRGB(65, 150, 255),
["Color Text"] = Color3.fromRGB(245, 245, 245),
["Color Dark Text"] = Color3.fromRGB(190, 190, 190)
},
Purple = {
["Color Hub 1"] = ColorSequence.new({
ColorSequenceKeypoint.new(0.00, Color3.fromRGB(27.5, 25,
30)),
ColorSequenceKeypoint.new(0.50, Color3.fromRGB(32.5, 32.5,
32.5)),
ColorSequenceKeypoint.new(1.00, Color3.fromRGB(27.5, 25,
30))
}),
["Color Hub 2"] = Color3.fromRGB(30, 30, 30),
["Color Stroke"] = Color3.fromRGB(40, 40, 40),
["Color Theme"] = Color3.fromRGB(150, 0, 255),
["Color Text"] = Color3.fromRGB(240, 240, 240),
["Color Dark Text"] = Color3.fromRGB(180, 180, 180)
}
},
Info = {
Version = "1.1.0"
},
Save = {
UISize = {550, 380},
TabSize = 160,
Theme = "Darker"
},
Settings = {},
Connection = {},
Instances = {},
Elements = {},
Options = {},
Flags = {},
Tabs = {},
Icons = loadstring(game:HttpGet("https://raw.githubusercontent.com/realredz/
RedzLibV5/refs/heads/main/Icons.lua"))()
}
Create = function(...)
local args = {...}
if type(args) ~= "table" then return end
local new = Instance.new(args[1])
local Children = {}
local Funcs = {} do
function Funcs:InsertCallback(tab, func)
if type(func) == "function" then
table.insert(tab, func)
end
return func
end
function Connected:Disconnect()
if self.Connected then
table.remove(ConnectedFuncs, table.find(ConnectedFuncs,
self.Function))
self.Connected = false
end
end
function Connected:Fire(...)
if self.Connected then
task.spawn(self.Function, ...)
end
end
return Connected
end
function Connect:Connect(func)
if type(func) == "function" then
table.insert(ConnectedFuncs, func)
return Funcs:GetConnectionFunctions(ConnectedFuncs,
func)
end
end
function Connect:Once(func)
if type(func) == "function" then
local Connected;
Connected =
Funcs:GetConnectionFunctions(ConnectedFuncs, _NFunc)
return Connected
end
end
end
end
GetFlag = function(Name)
return type(Name) == "string" and Flags[Name]
end
local db
Connection.FlagsChanged:Connect(function(Flag, Value)
local ScriptFile = Settings.ScriptFile
if not db and ScriptFile and writefile then
db=true;task.wait(0.1);db=false
if Success then
local Success = pcall(writefile, ScriptFile, Encoded)
if Success then
Connection:FireConnection("FileSaved", "Script-
Flags", ScriptFile, Encoded)
end
end
end
end)
end
Instance.MouseButton1Down:Connect(function()
InputOn = true
end)
Instance.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or
Input.UserInputType == Enum.UserInputType.Touch then
StartPos = Instance.Position
DragStart = Input.Position
while
UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
RunService.Heartbeat:Wait()
if InputOn then
Update(Input)
end
end
InputOn = false
end
end)
end)
return Instance
end
New.MouseEnter:Connect(function()
New.BackgroundTransparency = 0.4
end)
New.MouseLeave:Connect(function()
New.BackgroundTransparency = 0
end)
if args[1] then
New.Activated:Connect(args[1])
end
return New
end)
local Label = {}
function Label:SetTitle(NewTitle)
if type(NewTitle) == "string" and NewTitle:gsub(" ", ""):len() > 0 then
TitleL.Text = NewTitle
end
end
function Label:SetDesc(NewDesc)
if type(NewDesc) == "string" and NewDesc:gsub(" ", ""):len() > 0 then
DescL.Visible = true
DescL.Text = NewDesc
LabelHolder.Position = UDim2.new(0, 10, 0)
LabelHolder.AnchorPoint = Vector2.new(0, 0)
else
DescL.Visible = false
DescL.Text = ""
LabelHolder.Position = UDim2.new(0, 10, 0.5)
LabelHolder.AnchorPoint = Vector2.new(0, 0.5)
end
end
Label:SetTitle(Title)
Label:SetDesc(Description)
return Frame, Label
end
-- /////////// --
function redzlib:GetIcon(index)
if type(index) ~= "string" or index:find("rbxassetid://") or #index == 0 then
return index
end
function redzlib:SetTheme(NewTheme)
if not VerifyTheme(NewTheme) then return end
redzlib.Save.Theme = NewTheme
SaveJson("redz library V5.json", redzlib.Save)
Theme = redzlib.Themes[NewTheme]
Comnection:FireConnection("ThemeChanged", NewTheme)
table.foreach(redzlib.Instances, function(_,Val)
if Val.Type == "Gradient" then
Val.Instance.Color = Theme["Color Hub 1"]
elseif Val.Type == "Frame" then
Val.Instance.BackgroundColor3 = Theme["Color Hub 2"]
elseif Val.Type == "Stroke" then
Val.Instance[GetColor(Val.Instance)] = Theme["Color Stroke"]
elseif Val.Type == "Theme" then
Val.Instance[GetColor(Val.Instance)] = Theme["Color Theme"]
elseif Val.Type == "Text" then
Val.Instance[GetColor(Val.Instance)] = Theme["Color Text"]
elseif Val.Type == "DarkText" then
Val.Instance[GetColor(Val.Instance)] = Theme["Color Dark Text"]
elseif Val.Type == "ScrollBar" then
Val.Instance[GetColor(Val.Instance)] = Theme["Color Theme"]
end
end)
end
function redzlib:SetScale(NewScale)
NewScale = ViewportSize.Y / math.clamp(NewScale, 300, 2000)
UIScale, ScreenGui.Scale.Scale = NewScale, NewScale
end
function redzlib:MakeWindow(Configs)
local WTitle = Configs[1] or Configs.Name or Configs.Title or "redz Library
V5"
local WMiniText = Configs[2] or Configs.SubTitle or "by : redz9999"
if s and r then
local s, _Flags = pcall(readfile, File)
ControlSize1:GetPropertyChangedSignal("Position"):Connect(ControlSize)
ControlSize2:GetPropertyChangedSignal("Position"):Connect(ControlSize)
ConnectSave(ControlSize1, function()
if not Minimized then
redzlib.Save.UISize = {MainFrame.Size.X.Offset,
MainFrame.Size.Y.Offset}
SaveJson("redz library V5.json", redzlib.Save)
end
end)
ConnectSave(ControlSize2, function()
redzlib.Save.TabSize = MainScroll.Size.X.Offset
SaveJson("redz library V5.json", redzlib.Save)
end)
SetChildren(ButtonsFolder, {
CloseButton,
MinimizeButton
})
if Minimized then
MinimizeButton.Image = "rbxassetid://10734896206"
CreateTween({MainFrame, "Size", SaveSize, 0.25, true})
ControlSize1.Visible = true
ControlSize2.Visible = true
Minimized = false
else
MinimizeButton.Image = "rbxassetid://10734924532"
SaveSize = MainFrame.Size
ControlSize1.Visible = false
ControlSize2.Visible = false
CreateTween({MainFrame, "Size",
UDim2.fromOffset(MainFrame.Size.X.Offset, 28), 0.25, true})
Minimized = true
end
WaitClick = false
end
function Window:Minimize()
MainFrame.Visible = not MainFrame.Visible
end
function Window:AddMinimizeButton(Configs)
local Button = MakeDrag(Create("ImageButton", ScreenGui, {
Size = UDim2.fromOffset(35, 35),
Position = UDim2.fromScale(0.15, 0.15),
BackgroundTransparency = 1,
BackgroundColor3 = Theme["Color Hub 2"],
AutoButtonColor = false
}))
SetProps(Button, Configs.Button)
Button.Activated:Connect(Window.Minimize)
return {
Stroke = Stroke,
Corner = Corner,
Button = Button
}
end
function Window:Set(Val1, Val2)
if type(Val1) == "string" and type(Val2) == "string" then
Title.Text = Val1
Title.SubTitle.Text = Val2
elseif type(Val1) == "string" then
Title.Text = Val1
end
end
function Window:Dialog(Configs)
if MainFrame:FindFirstChild("Dialog") then return end
if Minimized then
Window:MinimizeBtn()
end
MainCorner:Clone().Parent = Screen
Frame.Parent = Screen
CreateTween({Frame, "Size", UDim2.fromOffset(250, 150), 0.2})
CreateTween({Frame, "Transparency", 0, 0.15})
CreateTween({Screen, "Transparency", 0.3, 0.15})
ButtonCount = ButtonCount + 1
local Button = Make("Button", ButtonsHolder)
Make("Corner", Button)
SetProps(Button, {
Text = Name,
Font = Enum.Font.GothamBold,
TextColor3 = Theme["Color Text"],
TextSize = 12
})
local ContainerList = {}
function Window:T(paste, Configs)
if type(paste) == "table" then Configs = paste end
local TName = Configs[1] or Configs.Title or "Tab!"
local TIcon = Configs[2] or Configs.Icon or ""
TIcon = redzlib:GetIcon(TIcon)
if not TIcon:find("rbxassetid://") or TIcon:gsub("rbxassetid://",
""):len() < 6 then
TIcon = false
end
table.insert(ContainerList, Container)
FirstTab = true
local Tab = {}
table.insert(redzlib.Tabs, {TabInfo = {Name = TName, Icon = TIcon},
func = Tab, Cont = Container})
Tab.Cont = Container
function Tab:Disable()
Container.Parent = nil
CreateTween({LabelTitle, "TextTransparency", 0.3, 0.35})
CreateTween({LabelIcon, "ImageTransparency", 0.3, 0.35})
CreateTween({Selected, "Size", UDim2.new(0, 4, 0, 4), 0.35})
CreateTween({Selected, "BackgroundTransparency", 1, 0.35})
end
function Tab:Enable()
Tabs()
end
function Tab:Visible(Bool)
Funcs:ToggleVisible(TabSelect, Bool)
Funcs:ToggleParent(Container, Bool, Containers)
end
function Tab:Destroy() TabSelect:Destroy() Container:Destroy() end
function Tab:AddSection(Configs)
local SectionName = type(Configs) == "string" and Configs or
Configs[1] or Configs.Name or Configs.Title or Configs.Section
local Paragraph = {}
function Paragraph:Visible(...) Funcs:ToggleVisible(Frame, ...)
end
function Paragraph:Destroy() Frame:Destroy() end
function Paragraph:SetTitle(Val)
LabelFunc:SetTitle(GetStr(Val))
end
function Paragraph:SetDesc(Val)
LabelFunc:SetDesc(GetStr(Val))
end
function Paragraph:Set(Val1, Val2)
if Val1 and Val2 then
LabelFunc:SetTitle(GetStr(Val1))
LabelFunc:SetDesc(GetStr(Val2))
elseif Val1 then
LabelFunc:SetDesc(GetStr(Val1))
end
end
return Paragraph
end
function Tab:AddButton(Configs)
local BName = Configs[1] or Configs.Name or Configs.Title or
"Button!"
local BDescription = Configs.Desc or Configs.Description or ""
local Callback = Funcs:GetCallback(Configs, 2)
FButton.Activated:Connect(function()
Funcs:FireCallback(Callback)
end)
local Button = {}
function Button:Visible(...) Funcs:ToggleVisible(FButton, ...)
end
function Button:Destroy() FButton:Destroy() end
function Button:Callback(...) Funcs:InsertCallback(Callback, ...)
end
function Button:Set(Val1, Val2)
if type(Val1) == "string" and type(Val2) == "string" then
LabelFunc:SetTitle(Val1)
LabelFunc:SetDesc(Val2)
elseif type(Val1) == "string" then
LabelFunc:SetTitle(Val1)
elseif type(Val1) == "function" then
Callback = Val1
end
end
return Button
end
function Tab:AddToggle(Configs)
local TName = Configs[1] or Configs.Name or Configs.Title or
"Toggle"
local TDesc = Configs.Desc or Configs.Description or ""
local Callback = Funcs:GetCallback(Configs, 3)
local Flag = Configs[4] or Configs.Flag or false
local Default = Configs[2] or Configs.Default or false
if CheckFlag(Flag) then Default = GetFlag(Flag) end
local WaitClick
local function SetToggle(Val)
if WaitClick then return end
Button.Activated:Connect(function()
SetToggle(not Default)
end)
local Toggle = {}
function Toggle:Visible(...) Funcs:ToggleVisible(Button, ...) end
function Toggle:Destroy() Button:Destroy() end
function Toggle:Callback(...) Funcs:InsertCallback(Callback, ...)
() end
function Toggle:Set(Val1, Val2)
if type(Val1) == "string" and type(Val2) == "string" then
LabelFunc:SetTitle(Val1)
LabelFunc:SetDesc(Val2)
elseif type(Val1) == "string" then
LabelFunc:SetTitle(Val1, false, true)
elseif type(Val1) == "boolean" then
if WaitClick and Val2 then
repeat task.wait() until not WaitClick
end
task.spawn(SetToggle, Val1)
elseif type(Val1) == "function" then
Callback = Val1
end
end
return Toggle
end
function Tab:AddDropdown(Configs)
local DName = Configs[1] or Configs.Name or Configs.Title or
"Dropdown"
local DDesc = Configs.Desc or Configs.Description or ""
local DOptions = Configs[2] or Configs.Options or {}
local OpDefault = Configs[3] or Configs.Default or {}
local Flag = Configs[5] or Configs.Flag or false
local DMultiSelect = Configs.MultiSelect or false
local Callback = Funcs:GetCallback(Configs, 4)
local Button, LabelFunc = ButtonFrame(Container, DName, DDesc,
UDim2.new(1, -180))
if MultiSelect then
for index, Value in pairs(CheckFlag(Flag) and
GetFlag(Flag) or Default) do
if type(index) == "string" and (DOptions[index]
or table.find(DOptions, index)) then
Selected[index] = Value
elseif DOptions[Value] then
Selected[Value] = true
end
end
end
Selected[Option.Name] = Option.Stats
CallbackSelected()
else
Option.LastCB = tick()
Selected = Option.Value
CallbackSelected()
end
UpdateSelected()
end
Button.Activated:Connect(function()
Select(Options[Name])
end)
GetOptions = function()
return Options
end
AddNewOptions = function(List, Clear)
if Clear then
table.foreach(Options, RemoveOption)
end
table.foreach(List, AddOption)
CallbackSelected()
UpdateSelected()
end
table.foreach(DOptions, AddOption)
CallbackSelected()
UpdateSelected()
end
Button.Activated:Connect(Minimize)
NoClickFrame.MouseButton1Down:Connect(Disable)
NoClickFrame.MouseButton1Click:Connect(Disable)
MainFrame:GetPropertyChangedSignal("Visible"):Connect(Disable)
SelectedFrame:GetPropertyChangedSignal("AbsolutePosition"):Connect(CalculatePos)
Button.Activated:Connect(CalculateSize)
ScrollFrame.ChildAdded:Connect(CalculateSize)
ScrollFrame.ChildRemoved:Connect(CalculateSize)
CalculatePos()
CalculateSize()
local Dropdown = {}
function Dropdown:Visible(...) Funcs:ToggleVisible(Button, ...)
end
function Dropdown:Destroy() Button:Destroy() end
function Dropdown:Callback(...)
Funcs:InsertCallback(Callback, ...)(Selected) end
function Dropdown:Add(...)
local NewOptions = {...}
if type(NewOptions[1]) == "table" then
table.foreach(Option, function(_,Name)
AddOption(Name)
end)
else
table.foreach(NewOptions, function(_,Name)
AddOption(Name)
end)
end
end
function Dropdown:Remove(Option)
for index, Value in pairs(GetOptions()) do
if type(Option) == "number" and index == Option or
Value.Name == "Option" then
RemoveOption(index, Value.Value)
end
end
end
function Dropdown:Select(Option)
if type(Option) == "string" then
for _,Val in pairs(Options) do
if Val.Name == Option then
Val.Active()
end
end
elseif type(Option) == "number" then
for ind,Val in pairs(Options) do
if ind == Option then
Val.Active()
end
end
end
end
function Dropdown:Set(Val1, Clear)
if type(Val1) == "table" then
AddNewOptions(Val1, not Clear)
elseif type(Val1) == "function" then
Callback = Val1
end
end
return Dropdown
end
function Tab:AddSlider(Configs)
local SName = Configs[1] or Configs.Name or Configs.Title or
"Slider!"
local SDesc = Configs.Desc or Configs.Description or ""
local Min = Configs[2] or Configs.MinValue or Configs.Min or 10
local Max = Configs[3] or Configs.MaxValue or Configs.Max or 100
local Increase = Configs[4] or Configs.Increase or 1
local Callback = Funcs:GetCallback(Configs, 6)
local Flag = Configs[7] or Configs.Flag or false
local Default = Configs[5] or Configs.Default or 25
if CheckFlag(Flag) then Default = GetFlag(Flag) end
Min, Max = Min / Increase, Max / Increase
SliderIcon.Position = UDim2.new(math.clamp(ConfigureDpiPos,
0, 1), 0, 0.5, 0)
end
SliderHolder.MouseButton1Down:Connect(function()
CreateTween({SliderIcon, "Transparency", 0, 0.3})
Container.ScrollingEnabled = false
while
UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
task.wait()
ControlPos()
end
CreateTween({SliderIcon, "Transparency", 0.2, 0.3})
Container.ScrollingEnabled = true
SetFlag(Flag, Default)
end)
LabelVal:GetPropertyChangedSignal("Text"):Connect(function()
UIScale.Scale = 0.3
CreateTween({UIScale, "Scale", 1.2, 0.1})
CreateTween({LabelVal, "Rotation", math.random(-1, 1) * 5,
0.15, true})
CreateTween({UIScale, "Scale", 1, 0.2})
CreateTween({LabelVal, "Rotation", 0, 0.1})
end)
function SetSlider(NewValue)
if type(NewValue) ~= "number" then return end
SetFlag(Flag, NewValue)
CreateTween({ SliderIcon, "Position",
UDim2.fromScale(math.clamp(SliderPos, 0, 1), 0.5), 0.3, true })
end;SetSlider(Default)
SliderIcon:GetPropertyChangedSignal("Position"):Connect(UpdateValues)UpdateValues()
local Slider = {}
function Slider:Set(NewVal1, NewVal2)
if NewVal1 and NewVal2 then
LabelFunc:SetTitle(NewVal1)
LabelFunc:SetDesc(NewVal2)
elseif type(NewVal1) == "string" then
LabelFunc:SetTitle(NewVal1)
elseif type(NewVal1) == "function" then
Callback = NewVal1
elseif type(NewVal1) == "number" then
SetSlider(NewVal1)
end
end
function Slider:Callback(...) Funcs:InsertCallback(Callback, ...)
(tonumber(Default)) end
function Slider:Visible(...) Funcs:ToggleVisible(Button, ...) end
function Slider:Destroy() Button:Destroy() end
return Slider
end
function Tab:AddTextBox(Configs)
local TName = Configs[1] or Configs.Name or Configs.Title or
"Text Box"
local TDesc = Configs.Desc or Configs.Description or ""
local TDefault = Configs[2] or Configs.Default or ""
local TPlaceholderText = Configs[5] or Configs.PlaceholderText or
"Input"
local TClearText = Configs[3] or Configs.ClearText or false
local Callback = Funcs:GetCallback(Configs, 4)
if type(TDefault) ~= "string" or TDefault:gsub(" ", ""):len() < 1
then
TDefault = false
end
local TextBox = {}
local function Input()
local Text = TextBoxInput.Text
if Text:gsub(" ", ""):len() > 0 then
if TextBox.OnChanging then Text =
TextBox.OnChanging(Text) or Text end
Funcs:FireCallback(Callback, Text)
TextBoxInput.Text = Text
end
end
TextBoxInput.FocusLost:Connect(Input)Input()
TextBoxInput.FocusLost:Connect(function()
CreateTween({Pencil, "ImageColor3", Color3.fromRGB(255,
255, 255), 0.2})
end)
TextBoxInput.Focused:Connect(function()
CreateTween({Pencil, "ImageColor3", Theme["Color Theme"],
0.2})
end)
TextBox.OnChanging = false
function TextBox:Visible(...) Funcs:ToggleVisible(Button, ...)
end
function TextBox:Destroy() Button:Destroy() end
return TextBox
end
function Tab:AddDiscordInvite(Configs)
local Title = Configs[1] or Configs.Name or Configs.Title or
"Discord"
local Desc = Configs.Desc or Configs.Description or ""
local Logo = Configs[2] or Configs.Logo or ""
local Invite = Configs[3] or Configs.Invite or ""
local ClickDelay
JoinButton.Activated:Connect(function()
setclipboard(Invite)
if ClickDelay then return end
ClickDelay = true
SetProps(JoinButton, {
Text = "Copied to Clipboard",
BackgroundColor3 = Color3.fromRGB(100, 100, 100),
TextColor3 = Color3.fromRGB(150, 150, 150)
})task.wait(5)
SetProps(JoinButton, {
Text = "Join",
BackgroundColor3 = Color3.fromRGB(50, 150, 50),
TextColor3 = Color3.fromRGB(220, 220, 220)
})ClickDelay = false
end)
local DiscordInvite = {}
function DiscordInvite:Destroy() InviteHolder:Destroy() end
function DiscordInvite:Visible(...)
Funcs:ToggleVisible(InviteHolder, ...) end
return DiscordInvite
end
return Tab
end
CloseButton.Activated:Connect(Window.CloseBtn)
MinimizeButton.Activated:Connect(Window.MinimizeBtn)
return Window
end
return redzlib