Corescript formatting improvements and fixes

This commit is contained in:
Lewin Kelly 2024-03-23 20:22:08 +00:00
parent 7e5b593cd9
commit ab301bf734
20 changed files with 767 additions and 788 deletions

View File

@ -199,7 +199,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://banland.xyz/asset/?id=34854607</url></Content> <Content name="Image"><url>http://banland.xyz/asset?id=34854607</url></Content>
<string name="Name">hurtOverlay</string> <string name="Name">hurtOverlay</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>2</XS> <XS>2</XS>
@ -254,7 +254,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://banland.xyz/asset/?id=35238000</url></Content> <Content name="Image"><url>http://banland.xyz/asset?id=35238000</url></Content>
<string name="Name">bkg</string> <string name="Name">bkg</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0</XS> <XS>0</XS>
@ -282,7 +282,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://banland.xyz/asset/?id=35238036</url></Content> <Content name="Image"><url>http://banland.xyz/asset?id=35238036</url></Content>
<string name="Name">barRed</string> <string name="Name">barRed</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.0189999994</XS> <XS>0.0189999994</XS>
@ -338,7 +338,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://banland.xyz/asset/?id=35238053</url></Content> <Content name="Image"><url>http://banland.xyz/asset?id=35238053</url></Content>
<string name="Name">bar</string> <string name="Name">bar</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.0189999994</XS> <XS>0.0189999994</XS>
@ -366,7 +366,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://banland.xyz/asset/?id=34816363</url></Content> <Content name="Image"><url>http://banland.xyz/asset?id=34816363</url></Content>
<string name="Name">label</string> <string name="Name">label</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.680000007</XS> <XS>0.680000007</XS>

View File

@ -34,7 +34,7 @@ local function logErrorNonFatal(messageID: string, errObj: Types.Error?, ...)
end end
coroutine.wrap(function() coroutine.wrap(function()
error(errorString:gsub("\n", "\n "), 0) error(string.gsub(errorString, "\n", "\n "), 0)
end)() end)()
end end

View File

@ -16,7 +16,7 @@ local function parseError(err: string): Types.Error
return { return {
type = "Error", type = "Error",
raw = err, raw = err,
message = err:gsub("^.+:%d+:%s*", ""), message = string.gsub(err, "^.+:%d+:%s*", ""),
trace = trace or "Traceback not available", trace = trace or "Traceback not available",
} }
end end

15
Modules/Waiter.luau Normal file
View File

@ -0,0 +1,15 @@
-- Imagine a go waitgroup if it was good
return function(waitFunction: () -> ())
return function(count: number)
return {
wait = function()
repeat
waitFunction()
until count == 0
end,
finish = function()
count -= 1
end,
}
end
end

View File

@ -5,6 +5,7 @@ local fs = require "@lune/fs"
local process = require "@lune/process" local process = require "@lune/process"
local stdio = require "@lune/stdio" local stdio = require "@lune/stdio"
local task = require "@lune/task" local task = require "@lune/task"
local waiter = require "./Modules/Waiter"(task.wait)
local colour = stdio.color local colour = stdio.color
@ -23,10 +24,12 @@ local plugins = {}
-- Allow for running from the base or corescripts directories -- Allow for running from the base or corescripts directories
local cwd = process.cwd local cwd = process.cwd
local fromCoresDir = not not string.match(cwd, "corescripts/$") local fromCoresDir = not not string.match(cwd, "corescripts/$")
local normalCoresDir = if fromCoresDir then "./luau" else "./corescripts/luau" local coresDir = if fromCoresDir then "." else "./corescripts"
local normalPluginsDir = if fromCoresDir
then "./terrain plugins" -- local normalCoresDir = if fromCoresDir then "./luau" else "./corescripts/luau"
else "./corescripts/terrain plugins" local normalCoresDir = `{coresDir}/luau`
local normalPluginsDir = `{coresDir}/terrain plugins`
local outputDir = `{coresDir}/processed`
for _, core in ipairs(fs.readDir(normalCoresDir)) do for _, core in ipairs(fs.readDir(normalCoresDir)) do
table.insert( table.insert(
@ -36,11 +39,9 @@ for _, core in ipairs(fs.readDir(normalCoresDir)) do
) )
end end
for _, core in ipairs(fs.readDir(normalPluginsDir)) do for _, core in ipairs(fs.readDir(normalPluginsDir)) do
print(core)
table.insert(plugins, core) table.insert(plugins, core)
end end
local coresDir = if fromCoresDir then "." else "./corescripts"
local pluginsDir = if fromCoresDir local pluginsDir = if fromCoresDir
then "../Client deployer" then "../Client deployer"
else "./Client deployer" else "./Client deployer"
@ -56,13 +57,13 @@ local function processCores(
then `../{config}.json5` then `../{config}.json5`
else `{config}.json5` else `{config}.json5`
local w = waiter(#scripts)
for i, core in ipairs(scripts) do for i, core in ipairs(scripts) do
local newCore = if libraries local newCore = if libraries
then `{10000000 + i}.lua` then `{10000000 + i}.lua`
else string.gsub(core, "%.luau$", ".lua") else string.gsub(core, "%.luau$", ".lua")
print(`{coresDir}/{startDir}/{core}`, `{endDir}/{newCore}`)
task.spawn(function() task.spawn(function()
local cmd = process.spawn("darklua", { local cmd = process.spawn("darklua", {
"process", "process",
@ -77,33 +78,47 @@ local function processCores(
then `{green}Processed {core}{reset}` then `{green}Processed {core}{reset}`
else `{red}Error processing {core}: {cmd.stderr}{reset}` else `{red}Error processing {core}: {cmd.stderr}{reset}`
) )
w.finish()
end) end)
end end
w.wait()
end end
task.spawn(function() local args: { { any } } = {
processCores( { libraryCores, "Libraries", outputDir, "dense", true },
libraryCores, {
"Libraries",
`{coresDir}/processed`,
"dense",
true
)
end)
task.spawn(function()
processCores(
plugins, plugins,
"terrain plugins", "terrain plugins",
`{pluginsDir}/staging/BuiltInPlugins/terrain`, `{pluginsDir}/staging/BuiltInPlugins/terrain`,
"lines" "lines",
) },
end) { normalCores, "luau", outputDir, "dense" },
{ otherCores, "luau", outputDir, "lines" },
}
task.spawn(function() local w = waiter(#args)
processCores(normalCores, "luau", `{coresDir}/processed`, "dense")
end)
task.spawn(function() for _, arg in ipairs(args) do
processCores(otherCores, "luau", `{coresDir}/processed`, "lines") task.spawn(function()
end) processCores(unpack(arg))
w.finish()
end)
end
if #process.args == 0 then
return
end
w.wait()
local totalBytes = 0
for _, core in ipairs(fs.readDir(outputDir)) do
local file = fs.readFile(`{outputDir}/{core}`)
if not string.match(core, "%d+%.lua") then
continue
end
totalBytes += #file
end
print(`Total: {totalBytes / 1000} kb`)

View File

@ -4248,6 +4248,7 @@ declare class ContentProvider extends Instance
function RegisterEncryptedAsset(self, assetId: Content, encryptionKey: string): nil function RegisterEncryptedAsset(self, assetId: Content, encryptionKey: string): nil
function RegisterSessionEncryptedAsset(self, contentId: Content, sessionKey: string): nil function RegisterSessionEncryptedAsset(self, contentId: Content, sessionKey: string): nil
function SetBaseUrl(self, url: string): nil function SetBaseUrl(self, url: string): nil
function SetThreadPool(self, count: number): nil
function UnregisterDefaultEncryptionKey(self): nil function UnregisterDefaultEncryptionKey(self): nil
function UnregisterEncryptedAsset(self, assetId: Content): nil function UnregisterEncryptedAsset(self, assetId: Content): nil
end end
@ -4793,6 +4794,7 @@ end
declare class GamePassService extends Instance declare class GamePassService extends Instance
function SetPlayerHasPassUrl(self, playerHasPassUrl: string): nil
end end
declare class GameSettings extends Instance declare class GameSettings extends Instance
@ -5550,8 +5552,10 @@ declare class InsertService extends Instance
function LoadPackageAsset(self, url: Content): { Instance } function LoadPackageAsset(self, url: Content): { Instance }
function LoadPackageAssetAsync(self, url: Content): { Instance } function LoadPackageAssetAsync(self, url: Content): { Instance }
function SetAssetUrl(self, assetUrl: Content): nil function SetAssetUrl(self, assetUrl: string): nil
function SetAssetVersionUrl(self, assetVersionUrl: Content): nil function SetAssetVersionUrl(self, assetVersionUrl: string): nil
function SetBaseSetsUrl(self, baseSetsUrl: string): nil
function SetCollectionUrl(self, collectionUrl: string): nil
end end
declare class JointInstance extends Instance declare class JointInstance extends Instance
@ -5815,6 +5819,9 @@ declare class MarketplaceService extends Instance
function SignalPromptPurchaseFinished(self, player: Instance, assetId: number, success: boolean): nil function SignalPromptPurchaseFinished(self, player: Instance, assetId: number, success: boolean): nil
function SignalServerLuaDialogClosed(self, value: boolean): nil function SignalServerLuaDialogClosed(self, value: boolean): nil
function UserOwnsGamePassAsync(self, userId: number, gamePassId: number): boolean function UserOwnsGamePassAsync(self, userId: number, gamePassId: number): boolean
function SetProductInfoUrl(self, url: string): nil
function SetPlayerOwnsAssetUrl(self, url: string): nil
end end
declare class MaterialGenerationService extends Instance declare class MaterialGenerationService extends Instance
@ -7527,9 +7534,9 @@ declare class DataModel extends ServiceProvider
function GetObjectsList(self, urls: { any }): { any } function GetObjectsList(self, urls: { any }): { any }
function GetPlaySessionId(self): string function GetPlaySessionId(self): string
function HttpGet(self, url: string, synchronous: boolean, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string function HttpGet(self, url: string, synchronous: boolean, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string
function HttpGetAsync(self, url: string, synchronous: boolean, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string function HttpGetAsync(self, url: string, synchronous: boolean?, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string
function HttpPost(self, url: string, data: string, synchronous: boolean, contentType: string?, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string function HttpPost(self, url: string, data: string, synchronous: boolean, contentType: string?, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string
function HttpPostAsync(self, url: string, data: string, synchronous: boolean, contentType: string?, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string function HttpPostAsync(self, url: string, data: string?, synchronous: boolean?, contentType: string?, httpRequestType: EnumHttpRequestType?, doNotAllowDiabolicalMode: boolean?): string
function InsertObjectsAndJoinIfLegacyAsync(self, url: Content): { Instance } function InsertObjectsAndJoinIfLegacyAsync(self, url: Content): { Instance }
function IsContentLoaded(self): boolean function IsContentLoaded(self): boolean
function IsLoaded(self): boolean function IsLoaded(self): boolean
@ -7624,6 +7631,8 @@ declare class SocialService extends Instance
function SetBestFriendUrl(self, bestFriendUrl: string): nil function SetBestFriendUrl(self, bestFriendUrl: string): nil
function SetStuffUrl(self, stuffUrl: string): nil function SetStuffUrl(self, stuffUrl: string): nil
function SetPackageContentsUrl(self, stuffUrl: string): nil function SetPackageContentsUrl(self, stuffUrl: string): nil
function SetGroupUrl(self, groupUrl: string): nil
end end
declare class Sound extends Instance declare class Sound extends Instance
@ -9132,4 +9141,4 @@ declare LoadLibrary: ((libraryName: "RbxFusion") -> Fusion) & ((libraryName: "Rb
declare function settings(): GlobalSettings declare function settings(): GlobalSettings
declare function UserSettings(): UserSettings declare function UserSettings(): UserSettings
declare function PluginManager(): PluginManager declare function PluginManager(): PluginManager
declare function ypcall(f: () -> any, ...: any): (boolean, any) declare function ypcall(f: (() -> any) | (() -> ()), ...: any): (boolean, any)

View File

@ -1,3 +1,4 @@
--!strict
-- CoreGui.RobloxGui.CoreScripts/PurchasePromptScript -- CoreGui.RobloxGui.CoreScripts/PurchasePromptScript
print "[Mercury]: Loaded corescript 107893730" print "[Mercury]: Loaded corescript 107893730"
@ -25,7 +26,7 @@ end
-------------------------------- Global Variables ---------------------------------------- -------------------------------- Global Variables ----------------------------------------
-- utility variables -- utility variables
local baseUrl = ContentProvider.BaseUrl:lower() local baseUrl = string.lower(ContentProvider.BaseUrl)
-- data variables -- data variables
local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable
@ -205,7 +206,7 @@ local function userPurchaseActionsEnded(isSuccess: boolean)
end end
-- enums have no implicit conversion to numbers in lua, has to have a function to do this -- enums have no implicit conversion to numbers in lua, has to have a function to do this
local function currencyEnumToInt(currencyEnum: Enum.CurrencyType) local function currencyEnumToInt(currencyEnum: EnumItem)
if currencyEnum == Enum.CurrencyType.Tix then if currencyEnum == Enum.CurrencyType.Tix then
return 2 return 2
end end
@ -439,9 +440,7 @@ local function getPlayerBalance()
if not success then if not success then
print("Get player balance failed because", errorCode) print("Get player balance failed because", errorCode)
return return
end elseif playerBalance == "" then
if playerBalance == "" then
return return
end end
@ -506,9 +505,11 @@ local function canPurchaseItem()
end end
if currentProductInfo == nil or not success then if currentProductInfo == nil or not success then
descText = return true,
nil,
nil,
true,
"In-game sales are temporarily disabled. Please try again later." "In-game sales are temporarily disabled. Please try again later."
return true, nil, nil, true, descText
end end
if not purchasingConsumable then if not purchasingConsumable then
@ -976,7 +977,7 @@ local function userPurchaseProductActionsEnded(userIsClosingDialog)
if currentServerResponseTable then if currentServerResponseTable then
local isPurchased = false local isPurchased = false
if if
tostring(currentServerResponseTable.isValid):lower() string.lower(tostring(currentServerResponseTable.isValid))
== "true" == "true"
then then
isPurchased = true isPurchased = true
@ -1244,47 +1245,6 @@ local function createPurchasePromptGui()
) )
end end
-- next two functions control the "Purchasing..." overlay
-- next 2 functions are convenienvce creation functions for guis
-- local function cutSizeInHalfRecursive(_)
-- todo: change the gui size based on how much space we have
-- changeSize(instance, 0.5)
-- local children = instance:GetChildren()
-- for i = 1, #children do
-- cutSizeInHalfRecursive(children[i])
-- end
-- end
-- local function doubleSizeRecursive(_)
-- todo: change the gui size based on how much space we have
-- changeSize(instance, 2)
-- local children = instance:GetChildren()
-- for i = 1, #children do
-- doubleSizeRecursive(children[i])
-- end
-- end
-- local function modifyForSmallScreen()
-- cutSizeInHalfRecursive(purchaseDialog)
-- end
-- local function modifyForLargeScreen()
-- doubleSizeRecursive(purchaseDialog)
-- end
-- depending on screen size, we need to change the gui
-- local function changeGuiToScreenSize(smallScreen)
-- if smallScreen then
-- modifyForSmallScreen()
-- else
-- modifyForLargeScreen()
-- end
-- end
local function doPurchasePrompt( local function doPurchasePrompt(
player, player,
assetId, assetId,
@ -1359,21 +1319,3 @@ if enableBrowserWindowClosedEvent then
doPlayerFundsCheck(false) doPlayerFundsCheck(false)
end) end)
end end
-- Game.CoreGui.RobloxGui.Changed:connect(function()
-- local nowIsSmallScreen = (
-- game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
-- )
-- if nowIsSmallScreen and not isSmallScreen then
-- changeGuiToScreenSize(true)
-- elseif not nowIsSmallScreen and isSmallScreen then
-- changeGuiToScreenSize(false)
-- end
-- isSmallScreen = nowIsSmallScreen
-- end)
-- isSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold)
-- if isSmallScreen then
-- changeGuiToScreenSize(true)
-- end

View File

@ -1,3 +1,4 @@
--!strict
-- Script Context.StarterScript -- Script Context.StarterScript
print "[Mercury]: Loaded corescript 37801172" print "[Mercury]: Loaded corescript 37801172"

View File

@ -5,6 +5,9 @@ local News = require "../Modules/New"
local New = News.New local New = News.New
local Hydrate = News.Hydrate local Hydrate = News.Hydrate
local ContentProvider = game:GetService "ContentProvider"
local InsertService = game:GetService "InsertService"
local RbxGui = {} local RbxGui = {}
local function ScopedConnect( local function ScopedConnect(
@ -140,6 +143,45 @@ local function cancelSlide(areaSoak)
end end
end end
RbxGui.CreateMessageDialog = function(title, message, buttons)
local frame = New "Frame" {
Size = UDim2.new(0.5, 0, 0.5, 0),
Position = UDim2.new(0.25, 0, 0.25, 0),
Name = "MessageDialog",
Active = true,
Style = Enum.FrameStyle.RobloxRound,
New "TextLabel" {
Name = "Title",
Text = title,
BackgroundTransparency = 1,
TextColor3 = Colour3(221, 221, 221),
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(1, 0, 0.15, 0),
Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size36,
TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center,
},
New "TextLabel" {
Name = "Message",
Text = message,
TextColor3 = Colour3(221, 221, 221),
Position = UDim2.new(0.025, 0, 0.175, 0),
Size = UDim2.new(0.95, 0, 0.55, 0),
BackgroundTransparency = 1,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size18,
TextWrap = true,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
},
}
CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0))
return frame
end
RbxGui.CreateStyledMessageDialog = function(title, message, style, buttons) RbxGui.CreateStyledMessageDialog = function(title, message, style, buttons)
local frame = New "Frame" { local frame = New "Frame" {
Size = UDim2.new(0.5, 0, 0, 165), Size = UDim2.new(0.5, 0, 0, 165),
@ -201,45 +243,6 @@ RbxGui.CreateStyledMessageDialog = function(title, message, style, buttons)
return frame return frame
end end
RbxGui.CreateMessageDialog = function(title, message, buttons)
local frame = New "Frame" {
Size = UDim2.new(0.5, 0, 0.5, 0),
Position = UDim2.new(0.25, 0, 0.25, 0),
Name = "MessageDialog",
Active = true,
Style = Enum.FrameStyle.RobloxRound,
New "TextLabel" {
Name = "Title",
Text = title,
BackgroundTransparency = 1,
TextColor3 = Colour3(221, 221, 221),
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(1, 0, 0.15, 0),
Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size36,
TextXAlignment = Enum.TextXAlignment.Center,
TextYAlignment = Enum.TextYAlignment.Center,
},
New "TextLabel" {
Name = "Message",
Text = message,
TextColor3 = Colour3(221, 221, 221),
Position = UDim2.new(0.025, 0, 0.175, 0),
Size = UDim2.new(0.95, 0, 0.55, 0),
BackgroundTransparency = 1,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size18,
TextWrap = true,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Top,
},
}
CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0))
return frame
end
local scrollMouseCount local scrollMouseCount
RbxGui.CreateDropDownMenu = function(items, onSelect, forRoblox) RbxGui.CreateDropDownMenu = function(items, onSelect, forRoblox)
local width = UDim.new(0, 100) local width = UDim.new(0, 100)
@ -269,7 +272,7 @@ RbxGui.CreateDropDownMenu = function(items, onSelect, forRoblox)
New "ImageLabel" { New "ImageLabel" {
Name = "Icon", Name = "Icon",
Active = false, Active = false,
Image = "http://banland.xyz/asset/?id=45732894", Image = "http://banland.xyz/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),
@ -816,24 +819,27 @@ RbxGui.LayoutGuiObjects = function(frame, guiObjects, settingsTable)
end end
RbxGui.CreateSlider = function(steps, width, position) RbxGui.CreateSlider = function(steps, width, position)
local sliderGui = Instance.new "Frame" local sliderGui = New "Frame" {
sliderGui.Size = UDim2.new(1, 0, 1, 0) Size = UDim2.new(1, 0, 1, 0),
sliderGui.BackgroundTransparency = 1 BackgroundTransparency = 1,
sliderGui.Name = "SliderGui" Name = "SliderGui",
}
local sliderSteps = Instance.new "IntValue" local sliderSteps = New "IntValue" {
sliderSteps.Name = "SliderSteps" Name = "SliderSteps",
sliderSteps.Value = steps Value = steps,
sliderSteps.Parent = sliderGui Parent = sliderGui,
}
local areaSoak = Instance.new "TextButton" local areaSoak = New "TextButton" {
areaSoak.Name = "AreaSoak" Name = "AreaSoak",
areaSoak.Text = "" Text = "",
areaSoak.BackgroundTransparency = 1 BackgroundTransparency = 1,
areaSoak.Active = false Active = false,
areaSoak.Size = UDim2.new(1, 0, 1, 0) Size = UDim2.new(1, 0, 1, 0),
areaSoak.Visible = false Visible = false,
areaSoak.ZIndex = 4 ZIndex = 4,
}
sliderGui.AncestryChanged:connect(function(_, parent) sliderGui.AncestryChanged:connect(function(_, parent)
if parent == nil then if parent == nil then
@ -843,24 +849,23 @@ RbxGui.CreateSlider = function(steps, width, position)
end end
end) end)
local sliderPosition = Instance.new "IntValue" local sliderPosition = New "IntValue" {
sliderPosition.Name = "SliderPosition" Name = "SliderPosition",
sliderPosition.Value = 0 Value = 1,
sliderPosition.Parent = sliderGui Parent = sliderGui,
}
local bar = Instance.new "TextButton" local bar = New "TextButton" {
bar.Text = "" Text = "",
bar.AutoButtonColor = false AutoButtonColor = false,
bar.Name = "Bar" Name = "Bar",
bar.BackgroundColor3 = Color3.new(0, 0, 0) BackgroundColor3 = Color3.new(0, 0, 0),
if type(width) == "number" then Size = type(width) == "number" and UDim2.new(0, width, 0, 5)
bar.Size = UDim2.new(0, width, 0, 5) or UDim2.new(0, 200, 0, 5),
else BorderColor3 = Colour3(95, 95, 95),
bar.Size = UDim2.new(0, 200, 0, 5) ZIndex = 2,
end Parent = sliderGui,
bar.BorderColor3 = Colour3(95, 95, 95) }
bar.ZIndex = 2
bar.Parent = sliderGui
if if
position.X position.X
@ -873,14 +878,15 @@ RbxGui.CreateSlider = function(steps, width, position)
bar.Position = position bar.Position = position
end end
local slider = Instance.new "ImageButton" local slider = New "TextButton" {
slider.Name = "Slider" Name = "Slider",
slider.BackgroundTransparency = 1 BackgroundTransparency = 1,
slider.Image = "rbxasset://textures/ui/Slider.png" Image = "rbxasset://textures/ui/Slider.png",
slider.Position = UDim2.new(0, 0, 0.5, -10) Position = UDim2.new(0, 0, 0.5, -10),
slider.Size = UDim2.new(0, 20, 0, 20) Size = UDim2.new(0, 20, 0, 20),
slider.ZIndex = 3 ZIndex = 3,
slider.Parent = bar Parent = bar,
}
areaSoak.MouseLeave:connect(function() areaSoak.MouseLeave:connect(function()
if areaSoak.Visible then if areaSoak.Visible then
@ -937,48 +943,54 @@ RbxGui.CreateTrueScrollingFrame = function()
local descendantsChangeConMap = {} local descendantsChangeConMap = {}
local scrollingFrame = Instance.new "Frame" local scrollingFrame = New "Frame" {
scrollingFrame.Name = "ScrollingFrame" Name = "ScrollingFrame",
scrollingFrame.Active = true Active = true,
scrollingFrame.Size = UDim2.new(1, 0, 1, 0) Size = UDim2.new(1, 0, 1, 0),
scrollingFrame.ClipsDescendants = true ClipsDescendants = true,
}
local controlFrame = Instance.new "Frame" local controlFrame = New "Frame" {
controlFrame.Name = "ControlFrame" Name = "ControlFrame",
controlFrame.BackgroundTransparency = 1 BackgroundTransparency = 1,
controlFrame.Size = UDim2.new(0, 18, 1, 0) Size = UDim2.new(0, 18, 1, 0),
controlFrame.Position = UDim2.new(1, -20, 0, 0) Position = UDim2.new(1, -20, 0, 0),
controlFrame.Parent = scrollingFrame Parent = scrollingFrame,
}
local scrollBottom = Instance.new "BoolValue" local scrollBottom = New "BoolValue" {
scrollBottom.Value = false Value = false,
scrollBottom.Name = "ScrollBottom" Name = "ScrollBottom",
scrollBottom.Parent = controlFrame Parent = controlFrame,
}
local scrollUpValue = Instance.new "BoolValue" local scrollUpValue = New "BoolValue" {
scrollUpValue.Value = false Value = false,
scrollUpValue.Name = "scrollUp" Name = "scrollUp",
scrollUpValue.Parent = controlFrame Parent = controlFrame,
}
local scrollUpButton = Instance.new "TextButton" local scrollUpButton = New "TextButton" {
scrollUpButton.Name = "ScrollUpButton" Name = "ScrollUpButton",
scrollUpButton.Text = "" Text = "",
scrollUpButton.AutoButtonColor = false AutoButtonColor = false,
scrollUpButton.BackgroundColor3 = Color3.new(0, 0, 0) BackgroundColor3 = Color3.new(0, 0, 0),
scrollUpButton.BorderColor3 = Color3.new(1, 1, 1) BorderColor3 = Color3.new(1, 1, 1),
scrollUpButton.BackgroundTransparency = 0.5 BackgroundTransparency = 0.5,
scrollUpButton.Size = UDim2.new(0, 18, 0, 18) Size = UDim2.new(0, 18, 0, 18),
scrollUpButton.ZIndex = 2 ZIndex = 2,
scrollUpButton.Parent = controlFrame Parent = controlFrame,
}
for i = 1, 6 do for i = 1, 6 do
local triFrame = Instance.new "Frame" New "Frame" {
triFrame.BorderColor3 = Color3.new(1, 1, 1) BorderColor3 = Color3.new(1, 1, 1),
triFrame.Name = "tri" .. tostring(i) Name = "tri" .. i,
triFrame.ZIndex = 3 ZIndex = 3,
triFrame.BackgroundTransparency = 0.5 BackgroundTransparency = 0.5,
triFrame.Size = UDim2.new(0, 12 - ((i - 1) * 2), 0, 0) Size = UDim2.new(0, 12 - ((i - 1) * 2), 0, 0),
triFrame.Position = UDim2.new(0, 3 + (i - 1), 0.5, 2 - (i - 1)) Position = UDim2.new(0, 3 + (i - 1), 0.5, 2 - (i - 1)),
triFrame.Parent = scrollUpButton Parent = scrollUpButton,
}
end end
scrollUpButton.MouseEnter:connect(function() scrollUpButton.MouseEnter:connect(function()
scrollUpButton.BackgroundTransparency = 0.1 scrollUpButton.BackgroundTransparency = 0.1
@ -1018,43 +1030,48 @@ RbxGui.CreateTrueScrollingFrame = function()
end) end)
scrollDownButton.Parent = controlFrame scrollDownButton.Parent = controlFrame
local scrollTrack = Instance.new "Frame" local scrollTrack = New "Frame" {
scrollTrack.Name = "ScrollTrack" Name = "ScrollTrack",
scrollTrack.BackgroundTransparency = 1 BackgroundTransparency = 1,
scrollTrack.Size = UDim2.new(0, 18, 1, -38) Size = UDim2.new(0, 18, 1, -38),
scrollTrack.Position = UDim2.new(0, 0, 0, 19) Position = UDim2.new(0, 0, 0, 19),
scrollTrack.Parent = controlFrame Parent = controlFrame,
}
local scrollbar = Instance.new "TextButton" local scrollbar = New "TextButton" {
scrollbar.BackgroundColor3 = Color3.new(0, 0, 0) BackgroundColor3 = Color3.new(0, 0, 0),
scrollbar.BorderColor3 = Color3.new(1, 1, 1) BorderColor3 = Color3.new(1, 1, 1),
scrollbar.BackgroundTransparency = 0.5 BackgroundTransparency = 0.5,
scrollbar.AutoButtonColor = false AutoButtonColor = false,
scrollbar.Text = "" Text = "",
scrollbar.Active = true Active = true,
scrollbar.Name = "ScrollBar" Name = "ScrollBar",
scrollbar.ZIndex = 2 ZIndex = 2,
scrollbar.BackgroundTransparency = 0.5 Size = UDim2.new(0, 18, 0.1, 0),
scrollbar.Size = UDim2.new(0, 18, 0.1, 0) Position = UDim2.new(0, 0, 0, 0),
scrollbar.Position = UDim2.new(0, 0, 0, 0) Parent = scrollTrack,
scrollbar.Parent = scrollTrack }
local scrollNub = Instance.new "Frame" local function nub()
scrollNub.Name = "ScrollNub" return New "Frame" {
scrollNub.BorderColor3 = Color3.new(1, 1, 1) Name = "ScrollNub",
scrollNub.Size = UDim2.new(0, 10, 0, 0) BorderColor3 = Color3.new(1, 1, 1),
scrollNub.Position = UDim2.new(0.5, -5, 0.5, 0) Size = UDim2.new(0, 10, 0, 0),
scrollNub.ZIndex = 2 ZIndex = 2,
scrollNub.BackgroundTransparency = 0.5 BackgroundTransparency = 0.5,
scrollNub.Parent = scrollbar Parent = scrollbar,
}
end
local newNub = scrollNub:Clone() local scrollNub = Hydrate(nub()) {
newNub.Position = UDim2.new(0.5, -5, 0.5, -2) Position = UDim2.new(0.5, -5, 0.5, 0),
newNub.Parent = scrollbar }
local newNub = Hydrate(nub()) {
local lastNub = scrollNub:Clone() Position = UDim2.new(0.5, -5, 0.5, -2),
lastNub.Position = UDim2.new(0.5, -5, 0.5, 2) }
lastNub.Parent = scrollbar local lastNub = Hydrate(nub()) {
Position = UDim2.new(0.5, -5, 0.5, 2),
}
scrollbar.MouseEnter:connect(function() scrollbar.MouseEnter:connect(function()
scrollbar.BackgroundTransparency = 0.1 scrollbar.BackgroundTransparency = 0.1
@ -1069,14 +1086,15 @@ RbxGui.CreateTrueScrollingFrame = function()
lastNub.BackgroundTransparency = 0.5 lastNub.BackgroundTransparency = 0.5
end) end)
local mouseDrag = Instance.new "ImageButton" local mouseDrag = New "ImageButton" {
mouseDrag.Active = false Active = false,
mouseDrag.Size = UDim2.new(1.5, 0, 1.5, 0) Size = UDim2.new(1.5, 0, 1.5, 0),
mouseDrag.AutoButtonColor = false AutoButtonColor = false,
mouseDrag.BackgroundTransparency = 1 BackgroundTransparency = 1,
mouseDrag.Name = "mouseDrag" Name = "mouseDrag",
mouseDrag.Position = UDim2.new(-0.25, 0, -0.25, 0) Position = UDim2.new(-0.25, 0, -0.25, 0),
mouseDrag.ZIndex = 10 ZIndex = 10,
}
local function positionScrollBar(_, y, offset) local function positionScrollBar(_, y, offset)
local oldPos = scrollbar.Position local oldPos = scrollbar.Position
@ -1549,7 +1567,7 @@ RbxGui.CreateScrollingFrame = function(orderList, scrollStyle)
local scrollStamp = 0 local scrollStamp = 0
local scrollDrag = New "ImageButton" { local scrollDrag = New "ImageButton" {
Image = "http://banland.xyz/asset/?id=61367186", Image = "http://banland.xyz/asset?id=61367186",
Size = UDim2.new(1, 0, 0, 16), Size = UDim2.new(1, 0, 0, 16),
BackgroundTransparency = 1, BackgroundTransparency = 1,
Name = "ScrollDrag", Name = "ScrollDrag",
@ -2773,7 +2791,7 @@ RbxGui.CreateSetPanel = function(
local SmallThumbnailUrl local SmallThumbnailUrl
local LargeThumbnailUrl local LargeThumbnailUrl
local BaseUrl = game:GetService("ContentProvider").BaseUrl:lower() local BaseUrl = string.lower(ContentProvider.BaseUrl)
local ThumbUrl = `{BaseUrl}Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=` local ThumbUrl = `{BaseUrl}Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=`
if useAssetVersionId then if useAssetVersionId then
@ -3118,7 +3136,7 @@ RbxGui.CreateSetPanel = function(
local function showLargePreview(insertButton) local function showLargePreview(insertButton)
if insertButton:FindFirstChild "AssetId" then if insertButton:FindFirstChild "AssetId" then
delay(0, function() delay(0, function()
game:GetService("ContentProvider"):Preload( ContentProvider:Preload(
LargeThumbnailUrl .. tostring(insertButton.AssetId.Value) LargeThumbnailUrl .. tostring(insertButton.AssetId.Value)
) )
setGui.SetPanel.ItemPreview.LargePreview.Image = LargeThumbnailUrl setGui.SetPanel.ItemPreview.LargePreview.Image = LargeThumbnailUrl
@ -3212,17 +3230,9 @@ RbxGui.CreateSetPanel = function(
end end
local function createDropDownMenuButton(parent) local function createDropDownMenuButton(parent)
-- local dropDownButton = Instance.new "ImageButton"
-- dropDownButton.Name = "DropDownButton"
-- dropDownButton.Image = "http://banland.xyz/asset/?id=67581509"
-- dropDownButton.BackgroundTransparency = 1
-- dropDownButton.Size = UDim2.new(0, 16, 0, 16)
-- dropDownButton.Position = UDim2.new(1, -24, 0, 6)
-- dropDownButton.ZIndex = parent.ZIndex + 2
-- dropDownButton.Parent = parent
local dropDownButton = New "ImageButton" { local dropDownButton = New "ImageButton" {
Name = "DropDownButton", Name = "DropDownButton",
Image = "http://banland.xyz/asset/?id=67581509", Image = "http://banland.xyz/asset?id=67581509",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Size = UDim2.new(0, 16, 0, 16), Size = UDim2.new(0, 16, 0, 16),
Position = UDim2.new(1, -24, 0, 6), Position = UDim2.new(1, -24, 0, 6),
@ -3295,8 +3305,7 @@ RbxGui.CreateSetPanel = function(
local newImageUrl = SmallThumbnailUrl .. assetId local newImageUrl = SmallThumbnailUrl .. assetId
if newImageUrl ~= insertFrame.Button.ButtonImage.Image then if newImageUrl ~= insertFrame.Button.ButtonImage.Image then
delay(0, function() delay(0, function()
game:GetService("ContentProvider") ContentProvider:Preload(SmallThumbnailUrl .. assetId)
:Preload(SmallThumbnailUrl .. assetId)
insertFrame.Button.ButtonImage.Image = SmallThumbnailUrl insertFrame.Button.ButtonImage.Image = SmallThumbnailUrl
.. assetId .. assetId
end) end)
@ -3416,8 +3425,7 @@ RbxGui.CreateSetPanel = function(
Data.Category[Data.CurrentCategory].Button = button Data.Category[Data.CurrentCategory].Button = button
if SetCache[setId] == nil then if SetCache[setId] == nil then
SetCache[setId] = game:GetService("InsertService") SetCache[setId] = InsertService:GetCollection(setId)
:GetCollection(setId)
end end
Data.Category[Data.CurrentCategory].Contents = SetCache[setId] Data.Category[Data.CurrentCategory].Contents = SetCache[setId]
@ -3585,8 +3593,7 @@ RbxGui.CreateSetPanel = function(
local userData = {} local userData = {}
for id = 1, #userIdsForSets do for id = 1, #userIdsForSets do
local newUserData = game:GetService("InsertService") local newUserData = InsertService:GetUserSets(userIdsForSets[id])
:GetUserSets(userIdsForSets[id])
if newUserData and #newUserData > 2 then if newUserData and #newUserData > 2 then
-- start at #3 to skip over My Decals and My Models for each account -- start at #3 to skip over My Decals and My Models for each account
for category = 3, #newUserData do for category = 3, #newUserData do
@ -3745,7 +3752,7 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
end end
materialToImageMap[v] = materialToImageMap[v] =
{ Regular = `http://banland.xyz/asset/?id={toAdd}` } { Regular = `http://banland.xyz/asset?id={toAdd}` }
end end
local scrollFrame, scrollUp, scrollDown, recalculateScroll = local scrollFrame, scrollUp, scrollDown, recalculateScroll =
@ -3855,8 +3862,7 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
end end
RbxGui.CreateLoadingFrame = function(name, size, position) RbxGui.CreateLoadingFrame = function(name, size, position)
game:GetService("ContentProvider") ContentProvider:Preload "http://banland.xyz/asset?id=35238053"
:Preload "http://banland.xyz/asset/?id=35238053"
local loadingFrame = New "Frame" { local loadingFrame = New "Frame" {
Name = "LoadingFrame", Name = "LoadingFrame",
@ -3888,7 +3894,7 @@ RbxGui.CreateLoadingFrame = function(name, size, position)
local loadingGreenBar = New "ImageLabel" { local loadingGreenBar = New "ImageLabel" {
Name = "LoadingGreenBar", Name = "LoadingGreenBar",
Image = "http://banland.xyz/asset/?id=35238053", Image = "http://banland.xyz/asset?id=35238053",
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0, 0, 1, 0), Size = UDim2.new(0, 0, 1, 0),
Visible = false, Visible = false,
@ -4316,7 +4322,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
draggingVertical = false draggingVertical = false
areaSoak.Visible = false areaSoak.Visible = false
end) end)
areaSoak.MouseMoved:connect(function(_, y) areaSoak.MouseMoved:connect(function(_, y: number)
if not draggingVertical then if not draggingVertical then
return return
end end

View File

@ -28,7 +28,7 @@ local helpButton, updateCameraDropDownSelection, updateVideoCaptureDropDownSelec
local tweenTime = 0.2 local tweenTime = 0.2
local mouseLockLookScreenUrl = "http://banland.xyz/asset?id=54071825" local mouseLockLookScreenUrl = "http://banland.xyz/asset?id=54071825"
local classicLookScreenUrl = "http://banland.xyz/Asset?id=45915798" local classicLookScreenUrl = "http://banland.xyz/asset?id=45915798"
local hasGraphicsSlider = true local hasGraphicsSlider = true
local GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider local GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider
@ -417,17 +417,17 @@ local function createHelpDialog(baseZIndex)
buttons[2] = {} buttons[2] = {}
buttons[2].Text = "Move" buttons[2].Text = "Move"
buttons[2].Function = function() buttons[2].Function = function()
image.Image = "http://banland.xyz/Asset?id=45915811" image.Image = "http://banland.xyz/asset?id=45915811"
end end
buttons[3] = {} buttons[3] = {}
buttons[3].Text = "Gear" buttons[3].Text = "Gear"
buttons[3].Function = function() buttons[3].Function = function()
image.Image = "http://banland.xyz/Asset?id=45917596" image.Image = "http://banland.xyz/asset?id=45917596"
end end
buttons[4] = {} buttons[4] = {}
buttons[4].Text = "Zoom" buttons[4].Text = "Zoom"
buttons[4].Function = function() buttons[4].Function = function()
image.Image = "http://banland.xyz/Asset?id=45915825" image.Image = "http://banland.xyz/asset?id=45915825"
end end
CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0)) CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0))
@ -2025,7 +2025,7 @@ local createSaveDialogs = function()
-8 -8
) )
spinnerImage.BackgroundTransparency = 1 spinnerImage.BackgroundTransparency = 1
spinnerImage.Image = "http://banland.xyz/Asset?id=45880710" spinnerImage.Image = "http://banland.xyz/asset?id=45880710"
spinnerImage.Parent = spinnerFrame spinnerImage.Parent = spinnerFrame
spinnerIcons[spinnerNum] = spinnerImage spinnerIcons[spinnerNum] = spinnerImage
@ -2047,10 +2047,10 @@ local createSaveDialogs = function()
while pos < 8 do while pos < 8 do
if pos == spinPos or pos == ((spinPos + 1) % 8) then if pos == spinPos or pos == ((spinPos + 1) % 8) then
spinnerIcons[pos + 1].Image = spinnerIcons[pos + 1].Image =
"http://banland.xyz/Asset?id=45880668" "http://banland.xyz/asset?id=45880668"
else else
spinnerIcons[pos + 1].Image = spinnerIcons[pos + 1].Image =
"http://banland.xyz/Asset?id=45880710" "http://banland.xyz/asset?id=45880710"
end end
pos += 1 pos += 1

View File

@ -25,7 +25,7 @@ local popupFrame = New "Frame" {
Name = "Backing", Name = "Backing",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
Image = "http://banland.xyz/asset/?id=47574181", Image = "http://banland.xyz/asset?id=47574181",
ZIndex = 2, ZIndex = 2,
}, },
}, },

View File

@ -77,7 +77,7 @@ local CurrentLoadout = New "Frame" {
New "ImageLabel" { New "ImageLabel" {
Name = "Background", Name = "Background",
Size = UDim2.new(1.2, 0, 1.2, 0), Size = UDim2.new(1.2, 0, 1.2, 0),
Image = "http://banland.xyz/asset/?id=96536002", Image = "http://banland.xyz/asset?id=96536002",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Position = UDim2.new(-0.1, 0, -0.1, 0), Position = UDim2.new(-0.1, 0, -0.1, 0),
ZIndex = 0.0, ZIndex = 0.0,
@ -85,7 +85,7 @@ local CurrentLoadout = New "Frame" {
New "ImageLabel" { New "ImageLabel" {
Size = UDim2.new(1, 0, 0.025, 1), Size = UDim2.new(1, 0, 0.025, 1),
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
Image = "http://banland.xyz/asset/?id=97662207", Image = "http://banland.xyz/asset?id=97662207",
BackgroundTransparency = 1, BackgroundTransparency = 1,
}, },
}, },
@ -105,13 +105,13 @@ local CurrentLoadout = New "Frame" {
New "ImageLabel" { New "ImageLabel" {
Name = "Background", Name = "Background",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Image = "http://banland.xyz/asset/?id=97613075", Image = "http://banland.xyz/asset?id=97613075",
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
}, },
-- New "ImageLabel" { -- New "ImageLabel" {
-- Name = "Highlight", -- Name = "Highlight",
-- BackgroundTransparency = 1, -- BackgroundTransparency = 1,
-- Image = "http://banland.xyz/asset/?id=97643886", -- Image = "http://banland.xyz/asset?id=97643886",
-- Size = UDim2.new(1, 0, 1, 0), -- Size = UDim2.new(1, 0, 1, 0),
-- Visible = false, -- Visible = false,
-- } -- }
@ -183,7 +183,7 @@ New "ImageButton" {
Visible = false, Visible = false,
Name = "BackpackButton", Name = "BackpackButton",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Image = "http://banland.xyz/asset/?id=97617958", Image = "http://banland.xyz/asset?id=97617958",
Position = UDim2.new(0.5, -60, 1, -108), Position = UDim2.new(0.5, -60, 1, -108),
Size = UDim2.new(0, 120, 0, 18), Size = UDim2.new(0, 120, 0, 18),
Parent = gui.ControlFrame, Parent = gui.ControlFrame,
@ -283,7 +283,7 @@ New "Frame" {
New "ImageLabel" { New "ImageLabel" {
RobloxLocked = true, RobloxLocked = true,
Name = "XImage", Name = "XImage",
Image = "http://banland.xyz/asset/?id=75547445", Image = "http://banland.xyz/asset?id=75547445",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Position = UDim2.new(-0.25, -1, -0.25, -1), Position = UDim2.new(-0.25, -1, -0.25, -1),
Size = UDim2.new(1.5, 2, 1.5, 2), Size = UDim2.new(1.5, 2, 1.5, 2),
@ -495,7 +495,7 @@ New "Frame" {
New "ImageLabel" { New "ImageLabel" {
Name = "Background", Name = "Background",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Image = "http://banland.xyz/asset/?id=97613075", Image = "http://banland.xyz/asset?id=97613075",
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
}, },
New "ObjectValue" { New "ObjectValue" {

View File

@ -12,7 +12,7 @@ local RbxStamper = {}
-- Return: -- Return:
-- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't. -- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't.
-- hit - Whether there was a plane intersection. Value is true if there was, false if not. -- hit - Whether there was a plane intersection. Value is true if there was, false if not.
function PlaneIntersection(vectorPos) local function PlaneIntersection(vectorPos)
local hit = false local hit = false
local currCamera = game.Workspace.CurrentCamera local currCamera = game.Workspace.CurrentCamera
local startPos = Vector3.new( local startPos = Vector3.new(

View File

@ -1,19 +1,19 @@
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (1?) -- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (1?)
print "[Mercury]: Loaded corescript 89449008" print "[Mercury]: Loaded corescript 89449008"
local News = require "../Modules/New"
local New = News.New
local Hydrate = News.Hydrate
-- A couple of necessary functions -- A couple of necessary functions
local function waitForChild(instance, name) local function waitForChild(instance: Instance, name: string)
assert(instance)
assert(name)
while not instance:FindFirstChild(name) do while not instance:FindFirstChild(name) do
print("Waiting for ...", instance, name) print("Waiting for ...", instance, name)
instance.ChildAdded:wait() instance.ChildAdded:wait()
end end
return instance:FindFirstChild(name) return instance:FindFirstChild(name)
end end
local function waitForProperty(instance, property) local function waitForProperty(instance: Instance, property: string)
assert(instance)
assert(property)
while not instance[property] do while not instance[property] do
instance.Changed:wait() instance.Changed:wait()
end end
@ -42,7 +42,7 @@ local StaticTabName = "gear"
local backpack = script.Parent local backpack = script.Parent
local backpackItems = {} local backpackItems: { Tool | HopperBin } = {}
local buttons = {} local buttons = {}
local debounce = false local debounce = false
@ -108,38 +108,30 @@ scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0)
scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0) scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0)
scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList
local LoadoutButton = Instance.new "TextButton" for i = 1, 4 do
LoadoutButton.RobloxLocked = true New "TextButton" {
LoadoutButton.Name = "LoadoutButton" RobloxLocked = true,
LoadoutButton.Font = Enum.Font.ArialBold Name = "LoadoutButton",
LoadoutButton.FontSize = Enum.FontSize.Size14 Font = Enum.Font.ArialBold,
LoadoutButton.Position = UDim2.new(0, 0, 0, 0) FontSize = Enum.FontSize.Size14,
LoadoutButton.Size = UDim2.new(1, 0, 0, 32) Position = UDim2.new(0, 0, 0, 0),
LoadoutButton.Style = Enum.ButtonStyle.RobloxButton Size = UDim2.new(1, 0, 0, 32),
LoadoutButton.Text = "Loadout #1" Style = Enum.ButtonStyle.RobloxButton,
LoadoutButton.TextColor3 = Color3.new(1, 1, 1) Text = "Loadout #" .. i,
LoadoutButton.Parent = scrollFrameLoadout TextColor3 = Color3.new(1, 1, 1),
Parent = scrollFrameLoadout,
}
end
local LoadoutButtonTwo = LoadoutButton:clone() New "Frame" {
LoadoutButtonTwo.Text = "Loadout #2" Name = "ScrollBarLoadout",
LoadoutButtonTwo.Parent = scrollFrameLoadout BackgroundTransparency = 0.9,
BackgroundColor3 = Color3.new(1, 1, 1),
local LoadoutButtonThree = LoadoutButton:clone() BorderSizePixel = 0,
LoadoutButtonThree.Text = "Loadout #3" Size = UDim2.new(0, 17, 1, -36),
LoadoutButtonThree.Parent = scrollFrameLoadout Position = UDim2.new(0, 0, 0, 18),
Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea,
local LoadoutButtonFour = LoadoutButton:clone() }
LoadoutButtonFour.Text = "Loadout #4"
LoadoutButtonFour.Parent = scrollFrameLoadout
local scrollBarLoadout = Instance.new "Frame"
scrollBarLoadout.Name = "ScrollBarLoadout"
scrollBarLoadout.BackgroundTransparency = 0.9
scrollBarLoadout.BackgroundColor3 = Color3.new(1, 1, 1)
scrollBarLoadout.BorderSizePixel = 0
scrollBarLoadout.Size = UDim2.new(0, 17, 1, -36)
scrollBarLoadout.Position = UDim2.new(0, 0, 0, 18)
scrollBarLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
scrollDownLoadout.Position = UDim2.new(0, 0, 1, -17) scrollDownLoadout.Position = UDim2.new(0, 0, 1, -17)
@ -147,7 +139,7 @@ scrollUpLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
-- Begin Functions -- Begin Functions
function removeFromMap(map, object) local function removeFromMap(map, object)
for i = 1, #map do for i = 1, #map do
if map[i] == object then if map[i] == object then
table.remove(map, i) table.remove(map, i)
@ -156,7 +148,7 @@ function removeFromMap(map, object)
end end
end end
function robloxLock(instance) local function robloxLock(instance)
instance.RobloxLocked = true instance.RobloxLocked = true
local children = instance:GetChildren() local children = instance:GetChildren()
if children then if children then
@ -166,105 +158,14 @@ function robloxLock(instance)
end end
end end
function resize() local function buttonClick(button)
local size = 0
if gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X then
size = gearPreview.AbsoluteSize.X * 0.75
else
size = gearPreview.AbsoluteSize.Y * 0.75
end
waitForChild(gearPreview, "GearImage")
gearPreview.GearImage.Size = UDim2.new(0, size, 0, size)
gearPreview.GearImage.Position =
UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size)
resizeGrid()
end
function addToGrid(child)
if not child:IsA "Tool" then
if not child:IsA "HopperBin" then
return
end
end
if child:FindFirstChild "RobloxBuildTool" then
return
end
for _, v in pairs(backpackItems) do -- check to see if we already have this gear registered
if v == child then
return
end
end
table.insert(backpackItems, child)
local changeCon = child.Changed:connect(function(prop)
if prop == "Name" then
if buttons[child] then
if buttons[child].Image == "" then
buttons[child].GearText.Text = child.Name
end
end
end
end)
local ancestryCon
ancestryCon = child.AncestryChanged:connect(function(_, _)
local thisObject
for _, v in pairs(backpackItems) do
if v == child then
thisObject = v
break
end
end
waitForProperty(player, "Character")
waitForChild(player, "Backpack")
if
child.Parent ~= player.Backpack
and child.Parent ~= player.Character
then
if ancestryCon then
ancestryCon:disconnect()
end
if changeCon then
changeCon:disconnect()
end
for _, v in pairs(backpackItems) do
if v == thisObject then
if mouseEnterCons[buttons[v]] then
mouseEnterCons[buttons[v]]:disconnect()
end
if mouseClickCons[buttons[v]] then
mouseClickCons[buttons[v]]:disconnect()
end
buttons[v].Parent = nil
buttons[v] = nil
break
end
end
removeFromMap(backpackItems, thisObject)
resizeGrid()
else
resizeGrid()
end
updateGridActive()
end)
resizeGrid()
end
function buttonClick(button)
if button:FindFirstChild "UnequipContextMenu" and not button.Active then if button:FindFirstChild "UnequipContextMenu" and not button.Active then
button.UnequipContextMenu.Visible = true button.UnequipContextMenu.Visible = true
browsingMenu = true browsingMenu = true
end end
end end
function previewGear(button) local function previewGear(button)
if not browsingMenu then if not browsingMenu then
gearPreview.Visible = false gearPreview.Visible = false
gearPreview.GearImage.Image = button.Image gearPreview.GearImage.Image = button.Image
@ -272,7 +173,7 @@ function previewGear(button)
end end
end end
function findEmptySlot() local function findEmptySlot()
local smallestNum local smallestNum
local loadout = currentLoadout:GetChildren() local loadout = currentLoadout:GetChildren()
for i = 1, #loadout do for i = 1, #loadout do
@ -286,27 +187,46 @@ function findEmptySlot()
end end
end end
end end
if smallestNum == 10 then return smallestNum == 10 and 0 or smallestNum
smallestNum = 0 end
local function inLoadout(gear)
local children = currentLoadout:GetChildren()
for i = 1, #children do
if children[i]:IsA "Frame" then
local button = children[i]:GetChildren()
if
#button > 0
and button[1].GearReference.Value
and button[1].GearReference.Value == gear
then
return true
end
end
end end
return smallestNum return false
end end
function unequipGear(physGear) local function updateGridActive()
physGear.Parent = playerBackpack for _, v in pairs(backpackItems) do
updateGridActive() if buttons[v] then
local gear
local gearRef = buttons[v]:FindFirstChild "GearReference"
if gearRef then
gear = gearRef.Value
end
if (not gear) or inLoadout(gear) then
buttons[v].Active = false
else
buttons[v].Active = true
end
end
end
end end
function highlight(button) local function swapGearSlot(slot, newGearButton)
button.TextColor3 = Color3.new(0, 0, 0)
button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
end
function clearHighlight(button)
button.TextColor3 = Color3.new(1, 1, 1)
button.BackgroundColor3 = Color3.new(0, 0, 0)
end
function swapGearSlot(slot, newGearButton)
if not swapSlot.Value then -- signal loadout to swap a gear out if not swapSlot.Value then -- signal loadout to swap a gear out
swapSlot.Slot.Value = slot swapSlot.Slot.Value = slot
swapSlot.GearButton.Value = newGearButton swapSlot.GearButton.Value = newGearButton
@ -315,200 +235,16 @@ function swapGearSlot(slot, newGearButton)
end end
end end
function checkForSwap(button, x, y) local function resizeGrid()
local loadoutChildren = currentLoadout:GetChildren()
for i = 1, #loadoutChildren do
if
loadoutChildren[i]:IsA "Frame"
and string.find(loadoutChildren[i].Name, "Slot")
then
if
x >= loadoutChildren[i].AbsolutePosition.x
and x
<= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x)
then
if
y >= loadoutChildren[i].AbsolutePosition.y
and y
<= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y)
then
local slot =
tonumber(string.sub(loadoutChildren[i].Name, 5))
swapGearSlot(slot, button)
return true
end
end
end
end
return false
end
local UnequipGearMenuClick = function(element, menu)
if type(element.Action) ~= "number" then
return
end
local num = element.Action
if num == 1 then -- remove from loadout
unequipGear(menu.Parent.GearReference.Value)
local inventoryButton = menu.Parent
local gearToUnequip = inventoryButton.GearReference.Value
local loadoutChildren = currentLoadout:GetChildren()
local slot = -1
for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" then
local button = loadoutChildren[i]:GetChildren()
if
button[1]
and button[1].GearReference.Value == gearToUnequip
then
slot = button[1].SlotNumber.Text
break
end
end
end
swapGearSlot(slot, nil)
end
end
function getGearContextMenu()
local gearContextMenu = Instance.new "Frame"
gearContextMenu.Active = true
gearContextMenu.Name = "UnequipContextMenu"
gearContextMenu.Size = UDim2.new(0, 115, 0, 70)
gearContextMenu.Position = UDim2.new(0, -16, 0, -16)
gearContextMenu.BackgroundTransparency = 1
gearContextMenu.Visible = false
local gearContextMenuButton = Instance.new "TextButton"
gearContextMenuButton.Name = "UnequipContextMenuButton"
gearContextMenuButton.Text = ""
gearContextMenuButton.Style = Enum.ButtonStyle.RobloxButtonDefault
gearContextMenuButton.ZIndex = 8
gearContextMenuButton.Size = UDim2.new(1, 0, 1, -20)
gearContextMenuButton.Visible = true
gearContextMenuButton.Parent = gearContextMenu
local elementHeight = 12
local contextMenuElements = {}
local contextMenuElementsName = { "Remove Hotkey" }
for i = 1, #contextMenuElementsName do
local element = {}
element.Type = "Button"
element.Text = contextMenuElementsName[i]
element.Action = i
element.DoIt = UnequipGearMenuClick
table.insert(contextMenuElements, element)
end
for i, contextElement in ipairs(contextMenuElements) do
local element = contextElement
if element.Type == "Button" then
local button = Instance.new "TextButton"
button.Name = `UnequipContextButton{i}`
button.BackgroundColor3 = Color3.new(0, 0, 0)
button.BorderSizePixel = 0
button.TextXAlignment = Enum.TextXAlignment.Left
button.Text = ` {contextElement.Text}`
button.Font = Enum.Font.Arial
button.FontSize = Enum.FontSize.Size14
button.Size = UDim2.new(1, 8, 0, elementHeight)
button.Position = UDim2.new(0, 0, 0, elementHeight * i)
button.TextColor3 = Color3.new(1, 1, 1)
button.ZIndex = 9
button.Parent = gearContextMenuButton
if not IsTouchDevice() then
button.MouseButton1Click:connect(function()
if button.Active and not gearContextMenu.Parent.Active then
pcall(function()
element.DoIt(element, gearContextMenu)
end)
browsingMenu = false
gearContextMenu.Visible = false
clearHighlight(button)
clearPreview()
end
end)
button.MouseEnter:connect(function()
if button.Active and gearContextMenu.Parent.Active then
highlight(button)
end
end)
button.MouseLeave:connect(function()
if button.Active and gearContextMenu.Parent.Active then
clearHighlight(button)
end
end)
end
contextElement.Button = button
contextElement.Element = button
elseif element.Type == "Label" then
local frame = Instance.new "Frame"
frame.Name = `ContextLabel{i}`
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(1, 8, 0, elementHeight)
local label = Instance.new "TextLabel"
label.Name = "Text1"
label.BackgroundTransparency = 1
label.BackgroundColor3 = Color3.new(1, 1, 1)
label.BorderSizePixel = 0
label.TextXAlignment = Enum.TextXAlignment.Left
label.Font = Enum.Font.ArialBold
label.FontSize = Enum.FontSize.Size14
label.Position = UDim2.new(0, 0, 0, 0)
label.Size = UDim2.new(0.5, 0, 1, 0)
label.TextColor3 = Color3.new(1, 1, 1)
label.ZIndex = 9
label.Parent = frame
element.Label1 = label
if element.GetText2 then
label = Instance.new "TextLabel"
label.Name = "Text2"
label.BackgroundTransparency = 1
label.BackgroundColor3 = Color3.new(1, 1, 1)
label.BorderSizePixel = 0
label.TextXAlignment = Enum.TextXAlignment.Right
label.Font = Enum.Font.Arial
label.FontSize = Enum.FontSize.Size14
label.Position = UDim2.new(0.5, 0, 0, 0)
label.Size = UDim2.new(0.5, 0, 1, 0)
label.TextColor3 = Color3.new(1, 1, 1)
label.ZIndex = 9
label.Parent = frame
element.Label2 = label
end
frame.Parent = gearContextMenuButton
element.Label = frame
element.Element = frame
end
end
gearContextMenu.ZIndex = 4
gearContextMenu.MouseLeave:connect(function()
browsingMenu = false
gearContextMenu.Visible = false
clearPreview()
end)
robloxLock(gearContextMenu)
return gearContextMenu
end
function resizeGrid()
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if not v:FindFirstChild "RobloxBuildTool" then if not v:FindFirstChild "RobloxBuildTool" then
if not buttons[v] then if not buttons[v] then
local buttonClone = gearButton:clone() local buttonClone = Hydrate(gearButton:clone()) {
buttonClone.Parent = grid.ScrollingFrame Parent = grid.ScrollingFrame,
buttonClone.Visible = true Visible = true,
buttonClone.Image = v.TextureId Image = v.TextureId,
if buttonClone.Image == "" then }
if v.TextureId == "" then
buttonClone.GearText.Text = v.Name buttonClone.GearText.Text = v.Name
end end
@ -582,7 +318,294 @@ function resizeGrid()
recalculateScroll() recalculateScroll()
end end
function showPartialGrid(subset) local function resize()
local size = gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X
and gearPreview.AbsoluteSize.X * 0.75
or gearPreview.AbsoluteSize.Y * 0.75
waitForChild(gearPreview, "GearImage")
gearPreview.GearImage.Size = UDim2.new(0, size, 0, size)
gearPreview.GearImage.Position =
UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size)
resizeGrid()
end
local function addToGrid(child: Tool | HopperBin)
if
not (child:IsA "Tool" or child:IsA "HopperBin")
or child:FindFirstChild "RobloxBuildTool"
then
return
end
for _, v in pairs(backpackItems) do -- check to see if we already have this gear registered
if v == child then
return
end
end
table.insert(backpackItems, child)
local changeCon = child.Changed:connect(function(prop)
if prop == "Name" and buttons[child] and buttons[child].Image == "" then
buttons[child].GearText.Text = child.Name
end
end)
local ancestryCon
ancestryCon = child.AncestryChanged:connect(function()
local thisObject
for _, v in pairs(backpackItems) do
if v == child then
thisObject = v
break
end
end
waitForProperty(player, "Character")
waitForChild(player, "Backpack")
if
child.Parent ~= player.Backpack
and child.Parent ~= player.Character
then
if ancestryCon then
ancestryCon:disconnect()
end
if changeCon then
changeCon:disconnect()
end
for _, v in pairs(backpackItems) do
if v == thisObject then
if mouseEnterCons[buttons[v]] then
mouseEnterCons[buttons[v]]:disconnect()
end
if mouseClickCons[buttons[v]] then
mouseClickCons[buttons[v]]:disconnect()
end
buttons[v].Parent = nil
buttons[v] = nil
break
end
end
removeFromMap(backpackItems, thisObject)
end
resizeGrid()
updateGridActive()
end)
resizeGrid()
end
local function unequipGear(physGear)
physGear.Parent = playerBackpack
updateGridActive()
end
local function highlight(button)
button.TextColor3 = Color3.new(0, 0, 0)
button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
end
local function clearHighlight(button)
button.TextColor3 = Color3.new(1, 1, 1)
button.BackgroundColor3 = Color3.new(0, 0, 0)
end
function checkForSwap(button, x, y)
local loadoutChildren = currentLoadout:GetChildren()
for i = 1, #loadoutChildren do
if
loadoutChildren[i]:IsA "Frame"
and string.find(loadoutChildren[i].Name, "Slot")
then
if
x >= loadoutChildren[i].AbsolutePosition.x
and x
<= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x)
then
if
y >= loadoutChildren[i].AbsolutePosition.y
and y
<= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y)
then
local slot =
tonumber(string.sub(loadoutChildren[i].Name, 5))
swapGearSlot(slot, button)
return true
end
end
end
end
return false
end
local UnequipGearMenuClick = function(element, menu)
if type(element.Action) ~= "number" then
return
end
local num = element.Action
if num == 1 then -- remove from loadout
unequipGear(menu.Parent.GearReference.Value)
local inventoryButton = menu.Parent
local gearToUnequip = inventoryButton.GearReference.Value
local loadoutChildren = currentLoadout:GetChildren()
local slot = -1
for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" then
local button = loadoutChildren[i]:GetChildren()
if
button[1]
and button[1].GearReference.Value == gearToUnequip
then
slot = button[1].SlotNumber.Text
break
end
end
end
swapGearSlot(slot, nil)
end
end
local function clearPreview()
gearPreview.GearImage.Image = ""
gearPreview.GearStats.GearName.Text = ""
end
function getGearContextMenu()
local gearContextMenu = New "Frame" {
Active = true,
Name = "UnequipContextMenu",
Size = UDim2.new(0, 115, 0, 70),
Position = UDim2.new(0, -16, 0, -16),
BackgroundTransparency = 1,
Visible = false,
}
local gearContextMenuButton = New "TextButton" {
Name = "UnequipContextMenuButton",
Text = "",
Style = Enum.ButtonStyle.RobloxButtonDefault,
ZIndex = 8,
Size = UDim2.new(1, 0, 1, -20),
Visible = true,
Parent = gearContextMenu,
}
local elementHeight = 12
local contextMenuElements = {}
local contextMenuElementsName = { "Remove Hotkey" }
for i = 1, #contextMenuElementsName do
local element = {}
element.Type = "Button"
element.Text = contextMenuElementsName[i]
element.Action = i
element.DoIt = UnequipGearMenuClick
table.insert(contextMenuElements, element)
end
for i, contextElement in ipairs(contextMenuElements) do
local element = contextElement
if element.Type == "Button" then
local button = New "TextButton" {
Name = "UnequipContextButton" .. i,
BackgroundColor3 = Color3.new(0, 0, 0),
BorderSizePixel = 0,
TextXAlignment = Enum.TextXAlignment.Left,
Text = ` {contextElement.Text}`,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size14,
Size = UDim2.new(1, 8, 0, elementHeight),
Position = UDim2.new(0, 0, 0, elementHeight * i),
TextColor3 = Color3.new(1, 1, 1),
ZIndex = 9,
Parent = gearContextMenuButton,
}
if not IsTouchDevice() then
button.MouseButton1Click:connect(function()
if button.Active and not gearContextMenu.Parent.Active then
pcall(function()
element.DoIt(element, gearContextMenu)
end)
browsingMenu = false
gearContextMenu.Visible = false
clearHighlight(button)
clearPreview()
end
end)
button.MouseEnter:connect(function()
if button.Active and gearContextMenu.Parent.Active then
highlight(button)
end
end)
button.MouseLeave:connect(function()
if button.Active and gearContextMenu.Parent.Active then
clearHighlight(button)
end
end)
end
contextElement.Button = button
contextElement.Element = button
elseif element.Type == "Label" then
local frame = Instance.new "Frame"
frame.Name = `ContextLabel{i}`
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(1, 8, 0, elementHeight)
element.Label1 = New "TextLabel" {
Name = "Text1",
BackgroundTransparency = 1,
BackgroundColor3 = Color3.new(1, 1, 1),
BorderSizePixel = 0,
TextXAlignment = Enum.TextXAlignment.Left,
Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size14,
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0.5, 0, 1, 0),
TextColor3 = Color3.new(1, 1, 1),
ZIndex = 9,
Parent = frame,
}
if element.GetText2 then
element.Label2 = New "TextLabel" {
Name = "Text2",
BackgroundTransparency = 1,
BackgroundColor3 = Color3.new(1, 1, 1),
BorderSizePixel = 0,
TextXAlignment = Enum.TextXAlignment.Right,
Font = Enum.Font.Arial,
FontSize = Enum.FontSize.Size14,
Position = UDim2.new(0.5, 0, 0, 0),
Size = UDim2.new(0.5, 0, 1, 0),
TextColor3 = Color3.new(1, 1, 1),
ZIndex = 9,
Parent = frame,
}
end
frame.Parent = gearContextMenuButton
element.Label = frame
element.Element = frame
end
end
gearContextMenu.ZIndex = 4
gearContextMenu.MouseLeave:connect(function()
browsingMenu = false
gearContextMenu.Visible = false
clearPreview()
end)
robloxLock(gearContextMenu)
return gearContextMenu
end
local function showPartialGrid(subset)
for _, v in pairs(buttons) do for _, v in pairs(buttons) do
v.Parent = nil v.Parent = nil
end end
@ -594,51 +617,14 @@ function showPartialGrid(subset)
recalculateScroll() recalculateScroll()
end end
function showEntireGrid() local function showEntireGrid()
for _, v in pairs(buttons) do for _, v in pairs(buttons) do
v.Parent = grid.ScrollingFrame v.Parent = grid.ScrollingFrame
end end
recalculateScroll() recalculateScroll()
end end
function inLoadout(gear) local function centerGear(loadoutChildren)
local children = currentLoadout:GetChildren()
for i = 1, #children do
if children[i]:IsA "Frame" then
local button = children[i]:GetChildren()
if #button > 0 then
if
button[1].GearReference.Value
and button[1].GearReference.Value == gear
then
return true
end
end
end
end
return false
end
function updateGridActive()
for _, v in pairs(backpackItems) do
if buttons[v] then
local gear
local gearRef = buttons[v]:FindFirstChild "GearReference"
if gearRef then
gear = gearRef.Value
end
if (not gear) or inLoadout(gear) then
buttons[v].Active = false
else
buttons[v].Active = true
end
end
end
end
function centerGear(loadoutChildren)
local gearButtons = {} local gearButtons = {}
local lastSlotAdd local lastSlotAdd
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
@ -669,15 +655,7 @@ function centerGear(loadoutChildren)
end end
end end
function tabClickHandler(tabName) local function backpackOpenHandler(currentTab)
if tabName == StaticTabName then
backpackOpenHandler(tabName)
else
backpackCloseHandler(tabName)
end
end
function backpackOpenHandler(currentTab)
if currentTab and currentTab ~= StaticTabName then if currentTab and currentTab ~= StaticTabName then
backpack.Gear.Visible = false backpack.Gear.Visible = false
return return
@ -691,7 +669,7 @@ function backpackOpenHandler(currentTab)
tellBackpackReadyFunc:Invoke() tellBackpackReadyFunc:Invoke()
end end
function backpackCloseHandler(currentTab) local function backpackCloseHandler(currentTab)
if currentTab and currentTab ~= StaticTabName then if currentTab and currentTab ~= StaticTabName then
backpack.Gear.Visible = false backpack.Gear.Visible = false
return return
@ -704,7 +682,20 @@ function backpackCloseHandler(currentTab)
tellBackpackReadyFunc:Invoke() tellBackpackReadyFunc:Invoke()
end end
function loadoutCheck(child, selectState) local function tabClickHandler(tabName)
if tabName == StaticTabName then
backpackOpenHandler(tabName)
else
backpackCloseHandler(tabName)
end
end
local function loadoutCheck(
child: Instance & {
GearReference: ObjectValue,
},
selectState
)
if not child:IsA "ImageButton" then if not child:IsA "ImageButton" then
return return
end end
@ -713,39 +704,35 @@ function loadoutCheck(child, selectState)
if if
child:FindFirstChild "GearReference" child:FindFirstChild "GearReference"
and buttons[v]:FindFirstChild "GearReference" and buttons[v]:FindFirstChild "GearReference"
and buttons[v].GearReference.Value
== child.GearReference.Value
then then
if buttons[v].Active = selectState
buttons[v].GearReference.Value == child.GearReference.Value break
then
buttons[v].Active = selectState
break
end
end end
end end
end end
end end
function clearPreview() -- local function removeAllEquippedGear(physGear)
gearPreview.GearImage.Image = ""
gearPreview.GearStats.GearName.Text = ""
end
-- function removeAllEquippedGear(physGear)
-- local stuff = player.Character:GetChildren() -- local stuff = player.Character:GetChildren()
-- for i = 1, #stuff do -- for i = 1, #stuff do
-- if (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin") and stuff[i] ~= physGear then -- if
-- (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin")
-- and stuff[i] ~= physGear
-- then
-- stuff[i].Parent = playerBackpack -- stuff[i].Parent = playerBackpack
-- end -- end
-- end -- end
-- end -- end
-- function equipGear(physGear) -- local function equipGear(physGear)
-- removeAllEquippedGear(physGear) -- removeAllEquippedGear(physGear)
-- physGear.Parent = player.Character -- physGear.Parent = player.Character
-- updateGridActive() -- updateGridActive()
-- end -- end
function setupCharacterConnections() local function setupCharacterConnections()
if backpackAddCon then if backpackAddCon then
backpackAddCon:disconnect() backpackAddCon:disconnect()
end end
@ -796,19 +783,20 @@ function removeCharacterConnections()
end end
end end
function trim(s) local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1")) return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end end
function filterGear(terms) local function filterGear(terms)
local filteredGear = {} local filteredGear = {}
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if buttons[v] then local button = buttons[v]
local gearString = string.lower(buttons[v].GearReference.Value.Name) if button then
local gearString = string.lower(button.GearReference.Value.Name)
gearString = trim(gearString) gearString = trim(gearString)
for i = 1, #terms do for i = 1, #terms do
if string.match(gearString, terms[i]) then if string.match(gearString, terms[i]) then
table.insert(filteredGear, buttons[v]) table.insert(filteredGear, button)
break break
end end
end end
@ -817,7 +805,8 @@ function filterGear(terms)
return filteredGear return filteredGear
end end
function splitByWhitespace(text)
local function splitByWhitespace(text)
if type(text) ~= "string" then if type(text) ~= "string" then
return nil return nil
end end
@ -830,7 +819,8 @@ function splitByWhitespace(text)
end end
return terms return terms
end end
function showSearchGear(searchTerms)
local function showSearchGear(searchTerms)
if not backpack.Gear.Visible then if not backpack.Gear.Visible then
return return
end -- currently not active tab end -- currently not active tab
@ -852,7 +842,7 @@ function showSearchGear(searchTerms)
showPartialGrid(filteredButtons) showPartialGrid(filteredButtons)
end end
function nukeBackpack() local function nukeBackpack()
while #buttons > 0 do while #buttons > 0 do
table.remove(buttons) table.remove(buttons)
end end
@ -867,7 +857,7 @@ function nukeBackpack()
end end
end end
function coreGuiChanged(coreGuiType, enabled) local function coreGuiChanged(coreGuiType, enabled)
if if
coreGuiType == Enum.CoreGuiType.Backpack coreGuiType == Enum.CoreGuiType.Backpack
or coreGuiType == Enum.CoreGuiType.All or coreGuiType == Enum.CoreGuiType.All

View File

@ -81,14 +81,14 @@ end
---------------------------------------- Public Event Setup ---------------------------------------- ---------------------------------------- Public Event Setup ----------------------------------------
function publicEvent(eventName: string) local function publicEvent(eventName: string)
return New "BindableEvent" { return New "BindableEvent" {
Name = eventName, Name = eventName,
Parent = script, Parent = script,
} }
end end
function publicFunction(funcName: string, invokeFunc: () -> ()) local function publicFunction(funcName: string, invokeFunc: () -> ())
return New "BindableFunction" { return New "BindableFunction" {
Name = funcName, Name = funcName,
OnInvoke = invokeFunc, OnInvoke = invokeFunc,
@ -156,12 +156,22 @@ local function showBackpack()
backpackOpenEvent:Fire(currentTab) backpackOpenEvent:Fire(currentTab)
canToggle = true canToggle = true
readyForNextEvent = true readyForNextEvent = true
backpackButton.Image = "http://banland.xyz/asset/?id=97644093" backpackButton.Image = "http://banland.xyz/asset?id=97644093"
backpackButton.Position = backpackButton.Position =
UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103) UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
end) end)
end end
local function resetSearchBoxGui()
resetButton.Visible = false
searchBox.Text = searchDefaultText
end
local function resetSearch()
resetSearchBoxGui()
searchRequestedEvent:Fire()
end
local function hideBackpack() local function hideBackpack()
backpackIsOpen = false backpackIsOpen = false
readyForNextEvent = false readyForNextEvent = false
@ -210,7 +220,7 @@ local function toggleBackpack()
if backpackIsOpen then if backpackIsOpen then
Hydrate(loadoutBackground) { Hydrate(loadoutBackground) {
Image = "http://banland.xyz/asset/?id=97623721", Image = "http://banland.xyz/asset?id=97623721",
Position = UDim2.new(-0.03, 0, -0.17, 0), Position = UDim2.new(-0.03, 0, -0.17, 0),
Size = UDim2.new(1.05, 0, 1.25, 0), Size = UDim2.new(1.05, 0, 1.25, 0),
ZIndex = 2.0, ZIndex = 2.0,
@ -218,14 +228,13 @@ local function toggleBackpack()
} }
showBackpack() showBackpack()
else else
Hydrate(backpackButton) { -- No, it doesn't work if it's not in this exact order
Position = UDim2.new(0.5, -60, 1, -44), backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
Selected = false, loadoutBackground.Visible = false
Image = "http://banland.xyz/asset/?id=97617958", backpackButton.Selected = false
} backpackButton.Image = "http://banland.xyz/asset?id=97617958"
Hydrate(loadoutBackground) { Hydrate(loadoutBackground) {
Visible = false, Image = "http://banland.xyz/asset?id=96536002",
Image = "http://banland.xyz/asset/?id=96536002",
Position = UDim2.new(-0.1, 0, -0.1, 0), Position = UDim2.new(-0.1, 0, -0.1, 0),
Size = UDim2.new(1.2, 0, 1.2, 0), Size = UDim2.new(1.2, 0, 1.2, 0),
} }
@ -292,12 +301,7 @@ local function newTabClicked()
end end
local function trim(s) local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1")) return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
local function resetSearchBoxGui()
resetButton.Visible = false
searchBox.Text = searchDefaultText
end end
local function doSearch() local function doSearch()
@ -311,16 +315,11 @@ local function doSearch()
searchRequestedEvent:Fire(searchText) -- todo: replace this with termtable when table passing is possible searchRequestedEvent:Fire(searchText) -- todo: replace this with termtable when table passing is possible
end end
function resetSearch() local function backpackReady()
resetSearchBoxGui()
searchRequestedEvent:Fire()
end
local backpackReady = function()
readyForNextEvent = true readyForNextEvent = true
end end
function coreGuiChanged(coreGuiType, enabled) local function coreGuiChanged(coreGuiType, enabled)
if if
coreGuiType == Enum.CoreGuiType.Backpack coreGuiType == Enum.CoreGuiType.Backpack
or coreGuiType == Enum.CoreGuiType.All or coreGuiType == Enum.CoreGuiType.All

View File

@ -677,7 +677,7 @@ function Chat:CreateGui()
New "ImageLabel" { New "ImageLabel" {
Name = "Background", Name = "Background",
Image = "http://banland.xyz/asset/?id=97120937", --96551212'; Image = "http://banland.xyz/asset?id=97120937", --96551212';
Size = UDim2.new(1.3, 0, 1.64, 0), Size = UDim2.new(1.3, 0, 1.64, 0),
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1, BackgroundTransparency = 1,

View File

@ -1,3 +1,4 @@
--!strict
print "[Mercury]: Loaded Join corescript" print "[Mercury]: Loaded Join corescript"
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"
@ -194,7 +195,7 @@ local function onConnectionFailed(_, err)
end end
-- called when the client connection is rejected -- called when the client connection is rejected
function onConnectionRejected() local function onConnectionRejected()
connectionFailed:disconnect() connectionFailed:disconnect()
setMessage "This place is not available. Please try another" setMessage "This place is not available. Please try another"
end end

View File

@ -1,9 +1,10 @@
--!strict
print "[Mercury]: Loaded Studio corescript" print "[Mercury]: Loaded Studio corescript"
local MarketplaceService = game:GetService "MarketplaceService" -- local MarketplaceService = game:GetService "MarketplaceService"
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local SocialService = game:GetService "SocialService" -- local SocialService = game:GetService "SocialService"
local GamePassService = game:GetService "GamePassService" -- local GamePassService = game:GetService "GamePassService"
local ScriptInformationProvider = game:GetService "ScriptInformationProvider" local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
local ScriptContext = game:GetService "ScriptContext" local ScriptContext = game:GetService "ScriptContext"
-- Setup studio cmd bar & load core scripts -- Setup studio cmd bar & load core scripts
@ -18,37 +19,37 @@ ScriptInformationProvider:SetAssetUrl "http://banland.xyz/asset/"
InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base" InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d" InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d" InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
InsertService:SetAssetUrl "http://banland.xyz/asset/?id=%d" InsertService:SetAssetUrl "http://banland.xyz/asset?id=%d"
InsertService:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d" InsertService:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d"
InsertService:SetTrustLevel(0) InsertService:SetTrustLevel(0)
pcall(function() -- pcall(function()
SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d" -- SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end) -- end)
pcall(function() -- pcall(function()
SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d" -- SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end) -- end)
pcall(function() -- pcall(function()
SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d" -- SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end) -- end)
pcall(function() -- pcall(function()
SocialService:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d" -- SocialService:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end) -- end)
pcall(function() -- pcall(function()
SocialService:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d" -- SocialService:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end) -- end)
pcall(function() -- pcall(function()
GamePassService:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d" -- GamePassService:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end) -- end)
pcall(function() -- pcall(function()
MarketplaceService:SetProductInfoUrl "http://banland.xyz/marketplace/productinfo?assetId=%d" -- MarketplaceService:SetProductInfoUrl "http://banland.xyz/marketplace/productinfo?assetId=%d"
end) -- end)
pcall(function() -- pcall(function()
MarketplaceService:SetDevProductInfoUrl "http://banland.xyz/marketplace/productDetails?productId=%d" -- MarketplaceService:SetDevProductInfoUrl "http://banland.xyz/marketplace/productDetails?productId=%d"
end) -- end)
pcall(function() -- pcall(function()
MarketplaceService:SetPlayerOwnsAssetUrl "http://banland.xyz/ownership/hasasset?userId=%d&assetId=%d" -- MarketplaceService:SetPlayerOwnsAssetUrl "http://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
end) -- end)
local result, _ = pcall(function() local result, _ = pcall(function()
ScriptContext:AddStarterScript(37801172) ScriptContext:AddStarterScript(37801172)

View File

@ -37,7 +37,7 @@ settings().Diagnostics:LegacyScriptMode()
InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base" InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d" InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d" InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d" InsertService:SetAssetUrl "http://banland.xyz/asset?id=%d"
InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d" InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
pcall(function() pcall(function()
@ -84,7 +84,7 @@ end)
workspace:SetPhysicsThrottleEnabled(true) workspace:SetPhysicsThrottleEnabled(true)
function doVisit() local function doVisit()
message.Text = "Loading Game" message.Text = "Loading Game"
pcall(function() pcall(function()

View File

@ -71,7 +71,7 @@ local currentMaterial = 1
-- load our libraries -- load our libraries
local RbxGui = LoadLibrary "RbxGui" local RbxGui = LoadLibrary "RbxGui"
-- local RbxUtil = LoadLibrary "RbxUtility" -- local RbxUtil = LoadLibrary "RbxUtility"
ContentProvider:Preload "http://banland.xyz/asset/?id=82741829" ContentProvider:Preload "http://banland.xyz/asset?id=82741829"
------------------------- OBJECT DEFINITIONS --------------------- ------------------------- OBJECT DEFINITIONS ---------------------
@ -175,7 +175,7 @@ function MouseHighlighter.Create(mouseUse)
imageLabel.BackgroundTransparency = 1 imageLabel.BackgroundTransparency = 1
imageLabel.Size = UDim2.new(1, 0, 1, 0) imageLabel.Size = UDim2.new(1, 0, 1, 0)
imageLabel.Position = UDim2.new(-0.35, 0, -0.5, 0) imageLabel.Position = UDim2.new(-0.35, 0, -0.5, 0)
imageLabel.Image = "http://banland.xyz/asset/?id=82741829" imageLabel.Image = "http://banland.xyz/asset?id=82741829"
imageLabel.Parent = billboardGui imageLabel.Parent = billboardGui
local lastTweenChange local lastTweenChange
@ -617,7 +617,7 @@ function LoadProgressBar(text)
-8 -8
) )
spinnerImage.BackgroundTransparency = 1 spinnerImage.BackgroundTransparency = 1
spinnerImage.Image = "http://banland.xyz/asset/?id=45880710" spinnerImage.Image = "http://banland.xyz/asset?id=45880710"
spinnerImage.Parent = spinnerFrame spinnerImage.Parent = spinnerFrame
spinnerIcons[spinnerNum] = spinnerImage spinnerIcons[spinnerNum] = spinnerImage
@ -633,10 +633,10 @@ function LoadProgressBar(text)
while pos < 8 do while pos < 8 do
if pos == spinPos or pos == ((spinPos + 1) % 8) then if pos == spinPos or pos == ((spinPos + 1) % 8) then
spinnerIcons[pos + 1].Image = spinnerIcons[pos + 1].Image =
"http://banland.xyz/asset/?id=45880668" "http://banland.xyz/asset?id=45880668"
else else
spinnerIcons[pos + 1].Image = spinnerIcons[pos + 1].Image =
"http://banland.xyz/asset/?id=45880710" "http://banland.xyz/asset?id=45880710"
end end
pos = pos + 1 pos = pos + 1