Fix compiling script

This commit is contained in:
Lewin Kelly 2023-04-24 21:51:50 +01:00
parent 427d4c687c
commit 7e602a9d4b
2 changed files with 76 additions and 79 deletions

View File

@ -77,9 +77,9 @@ CreateButtons = function(frame, buttons, yPos, ySize)
end)(), end)(),
Text = obj.Text, Text = obj.Text,
TextColor3 = Color3.new(1, 1, 1), TextColor3 = Color3.new(1, 1, 1),
MouseButton1Click = onnect(obj.Function),
Parent = frame Parent = frame
}) })
button.MouseButton1Click:connect(obj.Function)
buttonObjs[buttonNum] = button buttonObjs[buttonNum] = button
buttonNum = buttonNum + 1 buttonNum = buttonNum + 1
end end
@ -130,7 +130,32 @@ t.CreateStyledMessageDialog = function(title, message, style, buttons)
Size = UDim2.new(0.5, 0, 0, 165), Size = UDim2.new(0.5, 0, 0, 165),
Position = UDim2.new(0.25, 0, 0.5, -72.5), Position = UDim2.new(0.25, 0, 0.5, -72.5),
Active = true, Active = true,
Style = Enum.FrameStyle.RobloxRound Style = Enum.FrameStyle.RobloxRound,
New("TextLabel", "Title", {
Text = title,
TextStrokeTransparency = 0,
BackgroundTransparency = 1,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
Position = UDim2.new(0, 80, 0, 0),
Size = UDim2.new(1, -80, 0, 40),
Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size36,
TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center
}),
New("TextLabel", "Message", {
Text = message,
TextStrokeTransparency = 0,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
Position = UDim2.new(0.025, 80, 0, 45),
Size = UDim2.new(0.95, -80, 0, 55),
BackgroundTransparency = 1,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size18,
TextWrap = true,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top
})
}) })
local styleImage = New("ImageLabel", "StyleImage", { local styleImage = New("ImageLabel", "StyleImage", {
BackgroundTransparency = 1, BackgroundTransparency = 1,
@ -149,33 +174,6 @@ t.CreateStyledMessageDialog = function(title, message, style, buttons)
return t.CreateMessageDialog(title, message, buttons) return t.CreateMessageDialog(title, message, buttons)
end end
styleImage.Parent = frame styleImage.Parent = frame
local titleLabel = New("TextLabel", "Title", {
Text = title,
TextStrokeTransparency = 0,
BackgroundTransparency = 1,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
Position = UDim2.new(0, 80, 0, 0),
Size = UDim2.new(1, -80, 0, 40),
Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size36,
TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center,
Parent = frame
})
local messageLabel = New("TextLabel", "Message", {
Text = message,
TextStrokeTransparency = 0,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
Position = UDim2.new(0.025, 80, 0, 45),
Size = UDim2.new(0.95, -80, 0, 55),
BackgroundTransparency = 1,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size18,
TextWrap = true,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
Parent = frame
})
CreateButtons(frame, buttons, UDim.new(0, 105), UDim.new(0, 40)) CreateButtons(frame, buttons, UDim.new(0, 105), UDim.new(0, 40))
return frame return frame
end end
@ -184,9 +182,8 @@ t.CreateMessageDialog = function(title, message, buttons)
Size = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0.5, 0, 0.5, 0),
Position = UDim2.new(0.25, 0, 0.25, 0), Position = UDim2.new(0.25, 0, 0.25, 0),
Active = true, Active = true,
Style = Enum.FrameStyle.RobloxRound Style = Enum.FrameStyle.RobloxRound,
}) New("TextLabel", "Title", {
local titleLabel = New("TextLabel", "Title", {
Text = title, Text = title,
BackgroundTransparency = 1, BackgroundTransparency = 1,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
@ -195,10 +192,9 @@ t.CreateMessageDialog = function(title, message, buttons)
Font = Enum.Font.ArialBold, Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size36, FontSize = Enum.FontSize.Size36,
TextXAlignment = Enum.TextXAlignment.Center, TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center, TextYAlignment = Enum.TextYAlignment.Center
Parent = frame }),
}) New("TextLabel", "Message", {
local messageLabel = New("TextLabel", "Message", {
Text = message, Text = message,
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
Position = UDim2.new(0.025, 0, 0.175, 0), Position = UDim2.new(0.025, 0, 0.175, 0),
@ -208,8 +204,8 @@ t.CreateMessageDialog = function(title, message, buttons)
FontSize = Enum.FontSize.Size18, FontSize = Enum.FontSize.Size18,
TextWrap = true, TextWrap = true,
TextXAlignment = Enum.TextXAlignment.Left, TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top, TextYAlignment = Enum.TextYAlignment.Top
Parent = frame })
}) })
CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0)) CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0))
return frame return frame
@ -234,17 +230,16 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox)
Style = Enum.ButtonStyle.RobloxButton, Style = Enum.ButtonStyle.RobloxButton,
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
Parent = frame, Parent = frame,
ZIndex = 2 ZIndex = 2,
}) New("ImageLabel", "Icon", {
local dropDownIcon = New("ImageLabel", "Icon", {
Active = false, Active = false,
Image = "http://www.roblox.com/asset/?id=45732894", Image = "http://www.roblox.com/asset/?id=45732894",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Size = UDim2.new(0, 11, 0, 6), Size = UDim2.new(0, 11, 0, 6),
Position = UDim2.new(1, -11, 0.5, -2), Position = UDim2.new(1, -11, 0.5, -2),
Parent = dropDownMenu,
ZIndex = 2 ZIndex = 2
}) })
})
local itemCount = #items local itemCount = #items
local dropDownItemCount = #items local dropDownItemCount = #items
local useScrollButtons = false local useScrollButtons = false
@ -460,7 +455,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox)
wait(0.1) wait(0.1)
end end
end) end)
local scrollbar = New("ImageLabel", "ScrollBar", { New("ImageLabel", "ScrollBar", {
Image = "rbxasset://textures/ui/scrollbar.png", Image = "rbxasset://textures/ui/scrollbar.png",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Size = UDim2.new(0, 18, (dropDownItemCount * 0.8) / ((dropDownItemCount + 1) * 0.8), -17 - 11 - 4), Size = UDim2.new(0, 18, (dropDownItemCount * 0.8) / ((dropDownItemCount + 1) * 0.8), -17 - 11 - 4),
@ -646,10 +641,11 @@ t.LayoutGuiObjects = function(frame, guiObjects, settingsTable)
if not settingsTable["TextButtonPositionPadY"] then if not settingsTable["TextButtonPositionPadY"] then
settingsTable["TextButtonPositionPadY"] = 2 settingsTable["TextButtonPositionPadY"] = 2
end end
local wrapperFrame = New("Frame", "WrapperFrame") local wrapperFrame = New("Frame", "WrapperFrame", {
wrapperFrame.BackgroundTransparency = 1 BackgroundTransparency = 1,
wrapperFrame.Size = UDim2.new(1, 0, 1, 0) Size = UDim2.new(1, 0, 1, 0),
wrapperFrame.Parent = frame Parent = frame
})
for _, child in ipairs(guiObjects) do for _, child in ipairs(guiObjects) do
child.Parent = wrapperFrame child.Parent = wrapperFrame
end end
@ -690,9 +686,10 @@ t.CreateSlider = function(steps, width, position)
areaSoak.Parent = getScreenGuiAncestor(sliderGui) areaSoak.Parent = getScreenGuiAncestor(sliderGui)
end end
end) end)
local sliderPosition = New("IntValue", "SliderPosition") local sliderPosition = New("IntValue", "SliderPosition", {
sliderPosition.Value = 0 Value = 0,
sliderPosition.Parent = sliderGui Parent = sliderGui
})
local bar = New("TextButton", "Bar", { local bar = New("TextButton", "Bar", {
Text = "", Text = "",
AutoButtonColor = false, AutoButtonColor = false,
@ -787,7 +784,7 @@ t.CreateTrueScrollingFrame = function()
Parent = controlFrame Parent = controlFrame
}) })
for i = 1, 6 do for i = 1, 6 do
local triFrame = New("Frame", "tri" .. tostring(i), { New("Frame", "tri" .. tostring(i), {
BorderColor3 = Color3.new(1, 1, 1), BorderColor3 = Color3.new(1, 1, 1),
ZIndex = 3, ZIndex = 3,
BackgroundTransparency = 0.5, BackgroundTransparency = 0.5,

View File

@ -664,9 +664,9 @@ t.LayoutGuiObjects = (frame, guiObjects, settingsTable) ->
--Wrapper frame takes care of styled objects --Wrapper frame takes care of styled objects
wrapperFrame = New "Frame", "WrapperFrame" wrapperFrame = New "Frame", "WrapperFrame"
wrapperFrame.BackgroundTransparency = 1 BackgroundTransparency: 1
wrapperFrame.Size = UDim2.new 1, 0, 1, 0 Size: UDim2.new 1, 0, 1, 0
wrapperFrame.Parent = frame Parent: frame
for _, child in ipairs guiObjects for _, child in ipairs guiObjects
child.Parent = wrapperFrame child.Parent = wrapperFrame
@ -713,8 +713,8 @@ t.CreateSlider = (steps, width, position) ->
sliderPosition = New "IntValue", "SliderPosition" sliderPosition = New "IntValue", "SliderPosition"
sliderPosition.Value = 0 Value: 0
sliderPosition.Parent = sliderGui Parent: sliderGui
bar = New "TextButton", "Bar" bar = New "TextButton", "Bar"
Text: "" Text: ""