Replace string concatenation with interplation in corescripts (with darklua 0.12)

This commit is contained in:
Lewin Kelly 2023-12-12 11:45:41 +00:00
parent b97ed39e10
commit da219017d7
17 changed files with 299 additions and 439 deletions

View File

@ -46,32 +46,20 @@ local spinnerIcons
local smallScreenThreshold = 450 local smallScreenThreshold = 450
-- user facing images -- user facing images
local assetUrls = {}
local assetUrl = "http://banland.xyz/Asset/?id=" local assetUrl = "http://banland.xyz/Asset/?id="
local errorImageUrl = assetUrl .. "42557901"
table.insert(assetUrls, errorImageUrl) local errorImageUrl = `{assetUrl}42557901`
local buyImageUrl = assetUrl .. "104651457" local buyImageUrl = `{assetUrl}104651457`
table.insert(assetUrls, buyImageUrl) local buyImageDownUrl = `{assetUrl}104651515`
local buyImageDownUrl = assetUrl .. "104651515" local buyImageDisabledUrl = `{assetUrl}104651532`
table.insert(assetUrls, buyImageDownUrl) local cancelButtonImageUrl = `{assetUrl}104651592`
local buyImageDisabledUrl = assetUrl .. "104651532" local cancelButtonDownUrl = `{assetUrl}104651639`
table.insert(assetUrls, buyImageDisabledUrl) local okButtonUrl = `{assetUrl}104651665`
local cancelButtonImageUrl = assetUrl .. "104651592" local okButtonPressedrl = `{assetUrl}104651707`
table.insert(assetUrls, cancelButtonImageUrl) local freeButtonImageUrl = `{assetUrl}104651733`
local cancelButtonDownUrl = assetUrl .. "104651639" local freeButtonImageDownUrl = `{assetUrl}104651761`
table.insert(assetUrls, cancelButtonDownUrl) local tixIcon = `{assetUrl}102481431`
local okButtonUrl = assetUrl .. "104651665" local robuxIcon = `{assetUrl}102481419`
table.insert(assetUrls, okButtonUrl)
local okButtonPressedrl = assetUrl .. "104651707"
table.insert(assetUrls, okButtonPressedrl)
local freeButtonImageUrl = assetUrl .. "104651733"
table.insert(assetUrls, freeButtonImageUrl)
local freeButtonImageDownUrl = assetUrl .. "104651761"
table.insert(assetUrls, freeButtonImageDownUrl)
local tixIcon = assetUrl .. "102481431"
table.insert(assetUrls, tixIcon)
local robuxIcon = assetUrl .. "102481419"
table.insert(assetUrls, robuxIcon)
-- user facing string -- user facing string
local buyHeaderText = "Buy" local buyHeaderText = "Buy"
@ -109,8 +97,21 @@ function getRbxUtility()
end end
function preloadAssets() function preloadAssets()
for i = 1, #assetUrls do for _, assetUrl in ipairs {
game:GetService("ContentProvider"):Preload(assetUrls[i]) errorImageUrl,
buyImageUrl,
buyImageDownUrl,
buyImageDisabledUrl,
cancelButtonImageUrl,
cancelButtonDownUrl,
okButtonUrl,
okButtonPressedrl,
freeButtonImageUrl,
freeButtonImageDownUrl,
tixIcon,
robuxIcon,
} do
game:GetService("ContentProvider"):Preload(assetUrl)
end end
end end
----------------------------- End Util Functions --------------------------------------------- ----------------------------- End Util Functions ---------------------------------------------
@ -224,15 +225,11 @@ function updatePurchasePromptData(_)
newItemDescription newItemDescription
if purchasingConsumable then if purchasingConsumable then
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl purchaseDialog.BodyFrame.ItemPreview.Image =
.. "thumbs/asset.ashx?assetid=" `{baseUrl}thumbs/asset.ashx?assetid={currentProductInfo.IconImageAssetId}&x=100&y=100&format=png`
.. tostring(currentProductInfo.IconImageAssetId)
.. "&x=100&y=100&format=png"
else else
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl purchaseDialog.BodyFrame.ItemPreview.Image =
.. "thumbs/asset.ashx?assetid=" `{baseUrl}thumbs/asset.ashx?assetid={currentAssetId}&x=100&y=100&format=png`
.. tostring(currentAssetId)
.. "&x=100&y=100&format=png"
end end
end end
@ -247,7 +244,7 @@ function doPlayerFundsCheck(checkIndefinitely)
and checkingPlayerFunds and checkingPlayerFunds
and canPurchase and canPurchase
do do
wait(1 / 10) wait(0.1)
canPurchase, insufficientFunds = canPurchaseItem() canPurchase, insufficientFunds = canPurchaseItem()
retries -= 1 retries -= 1
end end
@ -415,30 +412,19 @@ function doAcceptPurchase(_)
-- http call to do the purchase -- http call to do the purchase
local response = "none" local response = "none"
local url local url = `{getSecureApiBaseUrl()}marketplace/`
local currencyData = `&currencyTypeId={currencyEnumToInt(
currentCurrencyType
)}&currencyTypeId={currencyEnumToInt(
currentCurrencyType
)}`
-- consumables need to use a different url -- consumables need to use a different url
if purchasingConsumable then if purchasingConsumable then
url = getSecureApiBaseUrl() url ..= `submitpurchase?productId={currentProductId}{currencyData}&expectedUnitPrice={currentCurrencyAmount}&placeId={Game.PlaceId}`
.. "marketplace/submitpurchase?productId="
.. tostring(currentProductId)
.. "&currencyTypeId="
.. tostring(currencyEnumToInt(currentCurrencyType))
.. "&expectedUnitPrice="
.. tostring(currentCurrencyAmount)
.. "&placeId="
.. tostring(Game.PlaceId)
else else
url = getSecureApiBaseUrl() url ..= `purchase?productId={currentProductId}{currencyData}&purchasePrice={currentCurrencyAmount}&locationType=Game&locationId={Game.PlaceId}`
.. "marketplace/purchase?productId="
.. tostring(currentProductId)
.. "&currencyTypeId="
.. tostring(currencyEnumToInt(currentCurrencyType))
.. "&purchasePrice="
.. tostring(currentCurrencyAmount)
.. "&locationType=Game"
.. "&locationId="
.. Game.PlaceId
end end
local success, reason = ypcall(function() local success, reason = ypcall(function()
@ -652,7 +638,7 @@ local function getPlayerBalance()
local playerBalance local playerBalance
local success, errorCode = ypcall(function() local success, errorCode = ypcall(function()
playerBalance = playerBalance =
game:HttpGetAsync(getSecureApiBaseUrl() .. "currency/balance") game:HttpGetAsync(`{getSecureApiBaseUrl()}currency/balance`)
end) end)
if not success then if not success then
print("Get player balance failed because", errorCode) print("Get player balance failed because", errorCode)
@ -671,12 +657,12 @@ end
-- should open an external default browser window to this url -- should open an external default browser window to this url
function openBuyCurrencyWindow() function openBuyCurrencyWindow()
checkingPlayerFunds = true checkingPlayerFunds = true
GuiService:OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx") GuiService:OpenBrowserWindow(`{baseUrl}Upgrades/Robux.aspx`)
end end
function openBCUpSellWindow() function openBCUpSellWindow()
GuiService:OpenBrowserWindow( GuiService:OpenBrowserWindow(
baseUrl .. "Upgrades/BuildersClubMemberships.aspx" `{baseUrl}Upgrades/BuildersClubMemberships.aspx`
) )
end end
@ -714,18 +700,12 @@ function updateAfterBalanceText(playerBalance, notRightBc)
openBuyCurrencyWindow openBuyCurrencyWindow
) )
end end
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " purchaseDialog.BodyFrame.AfterBalanceButton.Text =
.. currencyTypeToString(currentCurrencyType) `You need R$ {-afterBalanceNumber} more to buy this, click here to purchase more.`
.. " "
.. tostring(-afterBalanceNumber)
.. " more to buy this, click here to purchase more."
return true, true return true, true
elseif afterBalanceNumber < 0 and keyWord == "tickets" then elseif afterBalanceNumber < 0 and keyWord == "tickets" then
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " purchaseDialog.BodyFrame.AfterBalanceButton.Text =
.. tostring(-afterBalanceNumber) `You need {-afterBalanceNumber} Tix more to buy this item.`
.. " "
.. currencyTypeToString(currentCurrencyType)
.. " more to buy this item."
return true, true -- user can't buy more tickets, so we say fail the transaction (maybe instead we can prompt them to trade currency???) return true, true -- user can't buy more tickets, so we say fail the transaction (maybe instead we can prompt them to trade currency???)
end end
end end
@ -735,11 +715,10 @@ function updateAfterBalanceText(playerBalance, notRightBc)
openBuyCurrencyWindowConnection:disconnect() openBuyCurrencyWindowConnection:disconnect()
openBuyCurrencyWindowConnection = nil openBuyCurrencyWindowConnection = nil
end end
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "Your balance after this transaction will be " purchaseDialog.BodyFrame.AfterBalanceButton.Text =
.. currencyTypeToString(currentCurrencyType) `Your balance after this transaction will be {currencyTypeToString(
.. " " currentCurrencyType
.. tostring(afterBalanceNumber) )} {afterBalanceNumber}.`
.. "."
return true, false return true, false
end end
@ -780,9 +759,7 @@ function canPurchaseItem()
local currentProductInfoRaw local currentProductInfoRaw
success = ypcall(function() success = ypcall(function()
currentProductInfoRaw = Game:HttpGetAsync( currentProductInfoRaw = Game:HttpGetAsync(
getSecureApiBaseUrl() `{getSecureApiBaseUrl()}marketplace/productDetails?productid={currentProductId}`
.. "marketplace/productDetails?productid="
.. tostring(currentProductId)
) )
end) end)
if success then if success then
@ -814,11 +791,7 @@ function canPurchaseItem()
local success2, errorCode = ypcall(function() local success2, errorCode = ypcall(function()
playerOwnsAsset = game:HttpGetAsync( playerOwnsAsset = game:HttpGetAsync(
getSecureApiBaseUrl() `{getSecureApiBaseUrl()}ownership/hasAsset?userId={game.Players.LocalPlayer.userId}&assetId={currentAssetId}`
.. "ownership/hasAsset?userId="
.. tostring(game.Players.LocalPlayer.userId)
.. "&assetId="
.. tostring(currentAssetId)
) )
end) end)
@ -925,7 +898,8 @@ end
-- function computeSpaceString(pLabel) -- function computeSpaceString(pLabel)
-- local nString = " " -- local nString = " "
-- local tempSpaceLabel = Instance.new "TextButton" -- local tempSpaceLabel = Instance.new "TextButton"
-- tempSpaceLabel.Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y) -- tempSpaceLabel.Size =
-- UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y)
-- tempSpaceLabel.FontSize = pLabel.FontSize -- tempSpaceLabel.FontSize = pLabel.FontSize
-- tempSpaceLabel.Parent = pLabel.Parent -- tempSpaceLabel.Parent = pLabel.Parent
-- tempSpaceLabel.BackgroundTransparency = 1 -- tempSpaceLabel.BackgroundTransparency = 1
@ -933,10 +907,10 @@ end
-- tempSpaceLabel.Name = "SpaceButton" -- tempSpaceLabel.Name = "SpaceButton"
-- while tempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do -- while tempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do
-- nString = nString .. " " -- nString ..= " "
-- tempSpaceLabel.Text = nString -- tempSpaceLabel.Text = nString
-- end -- end
-- nString = nString .. " " -- nString ..= " "
-- tempSpaceLabel.Text = "" -- tempSpaceLabel.Text = ""
-- return nString -- return nString
-- end -- end

View File

@ -624,9 +624,8 @@ function initializeDeveloperConsole()
message.TextWrapped = wordWrapToggleOn message.TextWrapped = wordWrapToggleOn
message.Size = UDim2.new(0.98, 0, 0, 2000) message.Size = UDim2.new(0.98, 0, 0, 2000)
message.Parent = Dev_Container message.Parent = Dev_Container
message.Text = messageList[i].Time message.Text =
.. " -- " `{messageList[i].Time} -- {messageList[i].Message}`
.. messageList[i].Message
message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y) message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y)
message.Position = UDim2.new(0, 5, 0, posOffset) message.Position = UDim2.new(0, 5, 0, posOffset)

View File

@ -292,7 +292,7 @@ local function presentDialogChoices(talkingPart, dialogChoices)
end end
lastChoice.Position = UDim2.new(0, 0, 0, yPosition) lastChoice.Position = UDim2.new(0, 0, 0, yPosition)
lastChoice.Number.Text = pos .. ")" lastChoice.Number.Text = `{pos})`
mainFrame.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32) mainFrame.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32)
mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20) mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20)
@ -312,7 +312,6 @@ local function renewKillswitch(dialog)
currentAbortDialogScript.Parent = dialog currentAbortDialogScript.Parent = dialog
end end
local function selectChoice(choice) local function selectChoice(choice)
renewKillswitch(currentConversationDialog) renewKillswitch(currentConversationDialog)

View File

@ -2186,18 +2186,18 @@ t.AutoTruncateTextObject = function(textLabel)
end end
else else
local len = string.len(text) local len = string.len(text)
textLabel.Text = text .. "~" textLabel.Text = `{text}~`
--Shrink the text --Shrink the text
local textSize = binaryGrow(0, len, function(pos) local textSize = binaryGrow(0, len, function(pos)
if pos == 0 then if pos == 0 then
textLabel.Text = "~" textLabel.Text = "~"
else else
textLabel.Text = string.sub(text, 1, pos) .. "~" textLabel.Text = `{string.sub(text, 1, pos)}~`
end end
return textLabel.TextFits return textLabel.TextFits
end) end)
shortText = string.sub(text, 1, textSize) .. "~" shortText = `{string.sub(text, 1, textSize)}~`
textLabel.Text = shortText textLabel.Text = shortText
--Make sure the fullLabel fits --Make sure the fullLabel fits
@ -2699,9 +2699,9 @@ t.CreateSetPanel = function(
and type(userIdsForSets) ~= "userdata" and type(userIdsForSets) ~= "userdata"
then then
error( error(
"CreateSetPanel: userIdsForSets (first arg) is of type " `CreateSetPanel: userIdsForSets (first arg) is of type {type(
.. type(userIdsForSets) userIdsForSets
.. ", should be of type table or userdata" )}, should be of type table or userdata`
) )
end end
if not objectSelected then if not objectSelected then
@ -2709,16 +2709,16 @@ t.CreateSetPanel = function(
end end
if type(objectSelected) ~= "function" then if type(objectSelected) ~= "function" then
error( error(
"CreateSetPanel: objectSelected (second arg) is of type " `CreateSetPanel: objectSelected (second arg) is of type {type(
.. type(objectSelected) objectSelected
.. ", should be of type function!" )}, should be of type function!`
) )
end end
if dialogClosed and type(dialogClosed) ~= "function" then if dialogClosed and type(dialogClosed) ~= "function" then
error( error(
"CreateSetPanel: dialogClosed (third arg) is of type " `CreateSetPanel: dialogClosed (third arg) is of type {type(
.. type(dialogClosed) dialogClosed
.. ", should be of type function!" )}, should be of type function!`
) )
end end
@ -2750,17 +2750,14 @@ t.CreateSetPanel = function(
local SmallThumbnailUrl local SmallThumbnailUrl
local LargeThumbnailUrl local LargeThumbnailUrl
local BaseUrl = game:GetService("ContentProvider").BaseUrl:lower() local BaseUrl = game:GetService("ContentProvider").BaseUrl:lower()
local ThumbUrl = `{BaseUrl}Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=`
if useAssetVersionId then if useAssetVersionId then
LargeThumbnailUrl = BaseUrl LargeThumbnailUrl = `{ThumbUrl}420&ht=420&assetversionid=`
.. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&assetversionid=" SmallThumbnailUrl = `{ThumbUrl}75&ht=75&assetversionid=`
SmallThumbnailUrl = BaseUrl
.. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&assetversionid="
else else
LargeThumbnailUrl = BaseUrl LargeThumbnailUrl = `{ThumbUrl}420&ht=420&aid=`
.. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid=" SmallThumbnailUrl = `{ThumbUrl}75&ht=75&aid=`
SmallThumbnailUrl = BaseUrl
.. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&aid="
end end
local function drillDownSetZIndex(parent, index) local function drillDownSetZIndex(parent, index)
@ -3135,7 +3132,7 @@ t.CreateSetPanel = function(
local function createTerrainTypeButton(name, parent) local function createTerrainTypeButton(name, parent)
local dropDownTextButton = Instance.new "TextButton" local dropDownTextButton = Instance.new "TextButton"
dropDownTextButton.Name = name .. "Button" dropDownTextButton.Name = `{name}Button`
dropDownTextButton.Font = Enum.Font.ArialBold dropDownTextButton.Font = Enum.Font.ArialBold
dropDownTextButton.FontSize = Enum.FontSize.Size14 dropDownTextButton.FontSize = Enum.FontSize.Size14
dropDownTextButton.BorderSizePixel = 0 dropDownTextButton.BorderSizePixel = 0
@ -3446,12 +3443,12 @@ t.CreateSetPanel = function(
local function resetAllSetButtonSelection() local function resetAllSetButtonSelection()
local setButtons = setGui.SetPanel.Sets.SetsLists:GetChildren() local setButtons = setGui.SetPanel.Sets.SetsLists:GetChildren()
for i = 1, #setButtons do for _, setButton in ipairs(setButtons) do
if setButtons[i]:IsA "TextButton" then if setButton:IsA "TextButton" then
setButtons[i].Selected = false setButton.Selected = false
setButtons[i].BackgroundTransparency = 1 setButton.BackgroundTransparency = 1
setButtons[i].TextColor3 = Color3.new(1, 1, 1) setButton.TextColor3 = Color3.new(1, 1, 1)
setButtons[i].BackgroundColor3 = Color3.new(1, 1, 1) setButton.BackgroundColor3 = Color3.new(1, 1, 1)
end end
end end
end end
@ -4026,9 +4023,9 @@ t.CreateLoadingFrame = function(name, size, position)
) )
if percent and type(percent) ~= "number" then if percent and type(percent) ~= "number" then
error( error(
"updateLoadingGuiPercent expects number as argument, got " `updateLoadingGuiPercent expects number as argument, got {type(
.. type(percent) percent
.. " instead" )} instead`
) )
end end
@ -4077,9 +4074,8 @@ t.CreateLoadingFrame = function(name, size, position)
loadingGreenBar.Changed:connect(function(prop) loadingGreenBar.Changed:connect(function(prop)
if prop == "Size" then if prop == "Size" then
loadingPercent.Text = tostring( loadingPercent.Text =
math.ceil(loadingGreenBar.Size.X.Scale * 100) `{math.ceil(loadingGreenBar.Size.X.Scale * 100)}%`
) .. "%"
end end
end) end)
@ -4120,7 +4116,7 @@ t.CreatePluginFrame = function(name, size, position, scrollable, parent)
end end
local dragBar = Instance.new "Frame" local dragBar = Instance.new "Frame"
dragBar.Name = tostring(name) .. "DragBar" dragBar.Name = `{name}DragBar`
dragBar.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255) dragBar.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255)
dragBar.BorderColor3 = Color3.new(0, 0, 0) dragBar.BorderColor3 = Color3.new(0, 0, 0)
if size then if size then
@ -4146,7 +4142,7 @@ t.CreatePluginFrame = function(name, size, position, scrollable, parent)
-- plugin name label -- plugin name label
local pluginNameLabel = Instance.new "TextLabel" local pluginNameLabel = Instance.new "TextLabel"
pluginNameLabel.Name = "BarNameLabel" pluginNameLabel.Name = "BarNameLabel"
pluginNameLabel.Text = " " .. tostring(name) pluginNameLabel.Text = ` {name}`
pluginNameLabel.TextColor3 = Color3.new(1, 1, 1) pluginNameLabel.TextColor3 = Color3.new(1, 1, 1)
pluginNameLabel.TextStrokeTransparency = 0 pluginNameLabel.TextStrokeTransparency = 0
pluginNameLabel.Size = UDim2.new(1, 0, 1, 0) pluginNameLabel.Size = UDim2.new(1, 0, 1, 0)

View File

@ -1257,7 +1257,7 @@ local function createGameSettingsMenu(baseZIndex, _)
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"Graphics Quality", "Graphics Quality",
"Increased to (" .. graphicsSetter.Text .. ")", `Increased to ({graphicsSetter.Text})`,
"", "",
2, 2,
function() end function() end
@ -1272,7 +1272,7 @@ local function createGameSettingsMenu(baseZIndex, _)
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"Graphics Quality", "Graphics Quality",
"Decreased to (" .. graphicsSetter.Text .. ")", `Decreased to ({graphicsSetter.Text})`,
"", "",
2, 2,
function() end function() end

View File

@ -218,7 +218,7 @@ local function getMembershipTypeIcon(membershipType, playerName)
elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then
return "rbxasset://textures/ui/TinyObcIcon.png" return "rbxasset://textures/ui/TinyObcIcon.png"
else else
error("Unknown membershipType" .. membershipType) error(`Unknown membershipType {membershipType}`)
end end
end end
@ -235,7 +235,7 @@ local function getFriendStatusIcon(friendStatus)
elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then
return "http://banland.xyz/asset/?id=99776838" return "http://banland.xyz/asset/?id=99776838"
else else
error("Unknown FriendStatus: " .. friendStatus) error(`Unknown FriendStatus {friendStatus}`)
end end
end end
@ -301,7 +301,7 @@ end
local function WaitForChild(parent, child) local function WaitForChild(parent, child)
while not parent:FindFirstChild(child) do while not parent:FindFirstChild(child) do
wait() wait()
debugprint(" child " .. parent.Name .. " waiting for " .. child) debugprint(` child {parent.Name} waiting for {child}`)
end end
return parent[child] return parent[child]
end end
@ -880,7 +880,7 @@ local DefaultEntriesOnScreen = 8
for _, i in pairs(Images) do for _, i in pairs(Images) do
Game:GetService("ContentProvider") Game:GetService("ContentProvider")
:Preload("http://banland.xyz/asset/?id=" .. i) :Preload(`http://banland.xyz/asset/?id={i}`)
end end
-- ordered array of 'score data', each entry has: -- ordered array of 'score data', each entry has:
@ -1171,26 +1171,25 @@ function HighlightMyRank(
MemberButton, MemberButton,
AdminButton AdminButton
) )
BanPlayerButton.Image = "http://banland.xyz/asset/?id=" BanPlayerButton.Image =
.. Images.LightPopupMid `http://banland.xyz/asset/?id={Images.LightPopupMid}`
VisitorButton.Image = "http://banland.xyz/asset/?id=" .. Images.DarkPopupMid VisitorButton.Image = `http://banland.xyz/asset/?id={Images.DarkPopupMid}`
MemberButton.Image = "http://banland.xyz/asset/?id=" .. Images.LightPopupMid MemberButton.Image = `http://banland.xyz/asset/?id={Images.LightPopupMid}`
AdminButton.Image = "http://banland.xyz/asset/?id=" AdminButton.Image = `http://banland.xyz/asset/?id={Images.DarkPopupBottom}`
.. Images.DarkPopupBottom
local rank = player.PersonalServerRank local rank = player.PersonalServerRank
if rank <= PrivilegeLevel.Banned then if rank <= PrivilegeLevel.Banned then
BanPlayerButton.Image = "http://banland.xyz/asset/?id=" BanPlayerButton.Image =
.. Images.LightBluePopupMid `http://banland.xyz/asset/?id={Images.LightBluePopupMid}`
elseif rank <= PrivilegeLevel.Visitor then elseif rank <= PrivilegeLevel.Visitor then
VisitorButton.Image = "http://banland.xyz/asset/?id=" VisitorButton.Image =
.. Images.DarkBluePopupMid `http://banland.xyz/asset/?id={Images.DarkBluePopupMid}`
elseif rank <= PrivilegeLevel.Member then elseif rank <= PrivilegeLevel.Member then
MemberButton.Image = "http://banland.xyz/asset/?id=" MemberButton.Image =
.. Images.LightBluePopupMid `http://banland.xyz/asset/?id={Images.LightBluePopupMid}`
elseif rank <= PrivilegeLevel.Admin then elseif rank <= PrivilegeLevel.Admin then
AdminButton.Image = "http://banland.xyz/asset/?id=" AdminButton.Image =
.. Images.DarkBluePopupBottom `http://banland.xyz/asset/?id={Images.DarkBluePopupBottom}`
end end
end end
@ -1467,7 +1466,7 @@ local function DoesStatExist(statName, exception)
and playerf.Player:FindFirstChild "leaderstats" and playerf.Player:FindFirstChild "leaderstats"
and playerf.Player.leaderstats:FindFirstChild(statName) and playerf.Player.leaderstats:FindFirstChild(statName)
then then
--print('player:' .. playerf['Player'].Name ..' has stat') -- print(`player {playerf.Player.Name} has stat`)
return true return true
end end
end end
@ -1625,9 +1624,7 @@ function RecreateScoreColumns(ptable)
-- make an entry for this object -- make an entry for this object
local nentry = MakeScoreEntry(entry, scoreval, panel) local nentry = MakeScoreEntry(entry, scoreval, panel)
if nentry then if nentry then
debugprint( debugprint(`adding {nentry.Name} to {entry.Player.Name}`)
"adding " .. nentry.Name .. " to " .. entry.Player.Name
)
nentry.Parent = panel nentry.Parent = panel
-- add score to team -- add score to team
if if
@ -1947,7 +1944,7 @@ function UpdateMaximize()
for j = 1, #ScoreNames, 1 do for j = 1, #ScoreNames, 1 do
local scoreval = ScoreNames[j] local scoreval = ScoreNames[j]
if i:FindFirstChild(scoreval.Name) and scoreval.XOffset then if i:FindFirstChild(scoreval.Name) and scoreval.XOffset then
--print('updateing stat position: ' .. scoreval['Name']) -- print(`updateing stat position {scoreval["Name"]}`)
i[scoreval.Name]:TweenPosition( i[scoreval.Name]:TweenPosition(
UDim2.new(RightEdgeSpace, -scoreval.XOffset, 0, 0), UDim2.new(RightEdgeSpace, -scoreval.XOffset, 0, 0),
"Out", "Out",
@ -2220,7 +2217,7 @@ function StartDrag(entry, startx, starty)
end end
local nowY = AbsoluteToPercent(nx, ny).Y local nowY = AbsoluteToPercent(nx, ny).Y
debugprint( debugprint(
"drag dist:" .. Vector2.new(startx - nx, starty - ny).magnitude `drag dist {Vector2.new(startx - nx, starty - ny).magnitude}`
) )
if if
Vector2.new(startx - nx, starty - ny).magnitude Vector2.new(startx - nx, starty - ny).magnitude
@ -2481,7 +2478,7 @@ end
--]] --]]
function LeaderstatsRemoved(_, playerEntry) function LeaderstatsRemoved(_, playerEntry)
while AddingFrameLock do while AddingFrameLock do
debugprint("waiting to insert " .. playerEntry.Player.Name) debugprint(`waiting to insert {playerEntry.Player.Name}`)
wait() wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -2699,7 +2696,7 @@ end
--]] --]]
local function InsertPlayerFrame(nplayer) local function InsertPlayerFrame(nplayer)
while AddingFrameLock do while AddingFrameLock do
debugprint("waiting to insert " .. nplayer.Name) debugprint(`waiting to insert {nplayer.Name}`)
wait() wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -3042,7 +3039,7 @@ local function SetPlayerToTeam(entry)
end end
-- if player was set to an invalid team, then set it back to neutral -- if player was set to an invalid team, then set it back to neutral
if not setToTeam and #(game.Teams:GetTeams()) > 0 then if not setToTeam and #(game.Teams:GetTeams()) > 0 then
debugprint(entry.Player.Name .. "could not find team") debugprint(`{entry.Player.Name} could not find team`)
entry.MyTeam = nil entry.MyTeam = nil
if not NeutralTeam then if not NeutralTeam then
AddNeutralTeam() AddNeutralTeam()
@ -3069,18 +3066,18 @@ function PlayerChanged(entry, property)
if property == "Neutral" then if property == "Neutral" then
-- if player changing to neutral -- if player changing to neutral
if entry.Player.Neutral and #(game.Teams:GetTeams()) > 0 then if entry.Player.Neutral and #(game.Teams:GetTeams()) > 0 then
debugprint(entry.Player.Name .. "setting to neutral") debugprint(`{entry.Player.Name} setting to neutral`)
FindRemovePlayerFromTeam(entry) FindRemovePlayerFromTeam(entry)
entry.MyTeam = nil entry.MyTeam = nil
if not NeutralTeam then if not NeutralTeam then
debugprint(entry.Player.Name .. "creating neutral team") debugprint(`{entry.Player.Name} creating neutral team`)
AddNeutralTeam() AddNeutralTeam()
else else
debugprint(entry.Player.Name .. "adding to neutral team") debugprint(`{entry.Player.Name} adding to neutral team`)
AddPlayerToTeam(NeutralTeam, entry) AddPlayerToTeam(NeutralTeam, entry)
end end
elseif #(game.Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase elseif #(game.Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase
debugprint(entry.Player.Name .. "has been set non-neutral") debugprint(`{entry.Player.Name} has been set non-neutral`)
SetPlayerToTeam(entry) SetPlayerToTeam(entry)
end end
BaseUpdate() BaseUpdate()
@ -3089,7 +3086,7 @@ function PlayerChanged(entry, property)
and not entry.Player.Neutral and not entry.Player.Neutral
and entry.Player ~= entry.MyTeam and entry.Player ~= entry.MyTeam
then then
debugprint(entry.Player.Name .. "setting to new team") debugprint(`{entry.Player.Name} setting to new team`)
SetPlayerToTeam(entry) SetPlayerToTeam(entry)
BaseUpdate() BaseUpdate()
elseif property == "Name" or property == "MembershipType" then elseif property == "Name" or property == "MembershipType" then
@ -3114,12 +3111,7 @@ end
function OnFriendshipChanged(player, friendStatus) function OnFriendshipChanged(player, friendStatus)
Delay(0.5, function() Delay(0.5, function()
debugprint( debugprint(
"friend status changed for:" `friend status changed for {player.Name} {friendStatus} vs {GetFriendStatus(player)}`
.. player.Name
.. " "
.. tostring(friendStatus)
.. " vs "
.. tostring(GetFriendStatus(player))
) )
for _, entry in ipairs(PlayerFrames) do for _, entry in ipairs(PlayerFrames) do
if entry.Player == player then if entry.Player == player then
@ -3130,7 +3122,7 @@ function OnFriendshipChanged(player, friendStatus)
elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then
entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position
+ UDim2.new(0, 17, 0, 0) + UDim2.new(0, 17, 0, 0)
debugprint("confirmed status:" .. player.Name) debugprint(`confirmed status {player.Name}`)
end end
entry.Frame.FriendLabel.Image = nicon entry.Frame.FriendLabel.Image = nicon
return return
@ -3586,7 +3578,7 @@ IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable"
-- while true do -- while true do
-- local str_players = "" -- local str_players = ""
-- for _, i in pairs(game.Players:GetPlayers()) do -- for _, i in pairs(game.Players:GetPlayers()) do
-- str_players ..= " " .. i.Name -- str_players ..= ` {i.Name}`
-- end -- end
-- debugplayers.Text = str_players -- debugplayers.Text = str_players
-- wait(0.5) -- wait(0.5)

View File

@ -44,12 +44,9 @@ function makeFriend(fromPlayer, toPlayer)
return return
end -- previously cancelled friend request, we don't want it! end -- previously cancelled friend request, we don't want it!
popup.PopupText.Text = "Accept Friend Request from " popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?`
.. tostring(fromPlayer.Name) popup.PopupImage.Image =
.. "?" `http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=352&y=352`
popup.PopupImage.Image = "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=352&y=352"
showTwoButtons() showTwoButtons()
popup.Visible = true popup.Visible = true
@ -116,10 +113,8 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
if event == Enum.FriendRequestEvent.Accept then if event == Enum.FriendRequestEvent.Accept then
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"You are Friends", "You are Friends",
"With " .. toPlayer.Name .. "!", `With {toPlayer.Name}!`,
"http://banland.xyz/thumbs/avatar.ashx?userId=" `http://banland.xyz/thumbs/avatar.ashx?userId={toPlayer.userId}&x=48&y=48`,
.. tostring(toPlayer.userId)
.. "&x=48&y=48",
5, 5,
function() end function() end
) )
@ -131,10 +126,8 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
end -- previously cancelled friend request, we don't want it! end -- previously cancelled friend request, we don't want it!
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"Friend Request", "Friend Request",
"From " .. fromPlayer.Name, `From {fromPlayer.Name}`,
"http://banland.xyz/thumbs/avatar.ashx?userId=" `http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`,
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
8, 8,
function() function()
makeFriend(fromPlayer, toPlayer) makeFriend(fromPlayer, toPlayer)
@ -143,10 +136,8 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
elseif event == Enum.FriendRequestEvent.Accept then elseif event == Enum.FriendRequestEvent.Accept then
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"You are Friends", "You are Friends",
"With " .. fromPlayer.Name .. "!", `With {fromPlayer.Name}!`,
"http://banland.xyz/thumbs/avatar.ashx?userId=" `http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`,
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
5, 5,
function() end function() end
) )

View File

@ -99,7 +99,7 @@ for i = 0, NumSlots do
slotFrame.BackgroundColor3 = Color3.new(0, 0, 0) slotFrame.BackgroundColor3 = Color3.new(0, 0, 0)
slotFrame.BackgroundTransparency = 1 slotFrame.BackgroundTransparency = 1
slotFrame.BorderColor3 = Color3.new(1, 1, 1) slotFrame.BorderColor3 = Color3.new(1, 1, 1)
slotFrame.Name = "Slot" .. tostring(i) slotFrame.Name = `Slot{i}`
slotFrame.ZIndex = 4.0 slotFrame.ZIndex = 4.0
if i == 0 then if i == 0 then
slotFrame.Position = UDim2.new(0.9, 0, 0, 0) slotFrame.Position = UDim2.new(0.9, 0, 0, 0)

View File

@ -792,7 +792,7 @@ local addingPlayerChild = function(
end end
local slotNum = slotToMod % 10 local slotNum = slotToMod % 10
local parent = currentLoadout:FindFirstChild("Slot" .. tostring(slotNum)) local parent = currentLoadout:FindFirstChild(`Slot{slotNum}`)
gearClone.Parent = parent gearClone.Parent = parent
if inventoryGearButton then if inventoryGearButton then

View File

@ -287,12 +287,12 @@ function JsonReader:ReadNumber()
local result = self:Next() local result = self:Next()
local peek = self:Peek() local peek = self:Peek()
while peek ~= nil and string.find(peek, "[%+%-%d%.eE]") do while peek ~= nil and string.find(peek, "[%+%-%d%.eE]") do
result = result .. self:Next() result ..= self:Next()
peek = self:Peek() peek = self:Peek()
end end
result = tonumber(result) result = tonumber(result)
if result == nil then if result == nil then
error(string.format("Invalid number: '%s'", result)) error(`"Invalid number: '{result}'`)
else else
return result return result
end end
@ -309,7 +309,7 @@ function JsonReader:ReadString()
ch = self.escapes[ch] ch = self.escapes[ch]
end end
end end
result = result .. ch result ..= ch
end end
assert(self:Next() == '"') assert(self:Next() == '"')
local fromunicode = function(m) local fromunicode = function(m)
@ -326,7 +326,7 @@ function JsonReader:ReadComment()
elseif second == "*" then elseif second == "*" then
self:ReadBlockComment() self:ReadBlockComment()
else else
error(string.format("Invalid comment: %s", self:All())) error(`Invalid comment: {self:All()}`)
end end
end end
@ -338,9 +338,7 @@ function JsonReader:ReadBlockComment()
done = true done = true
end end
if not done and ch == "/" and self:Peek() == "*" then if not done and ch == "/" and self:Peek() == "*" then
error( error(string.format(`Invalid comment: {self:All()}, '/*' illegal.`))
string.format("Invalid comment: %s, '/*' illegal.", self:All())
)
end end
end end
self:Next() self:Next()
@ -370,13 +368,7 @@ function JsonReader:ReadArray()
if not done then if not done then
local ch = self:Next() local ch = self:Next()
if ch ~= "," then if ch ~= "," then
error( error(`Invalid array: '{self:All()}' due to: '{ch}'`)
string.format(
"Invalid array: '%s' due to: '%s'",
self:All(),
ch
)
)
end end
end end
end end
@ -394,18 +386,12 @@ function JsonReader:ReadObject()
while not done do while not done do
local key = self:Read() local key = self:Read()
if type(key) ~= "string" then if type(key) ~= "string" then
error(string.format("Invalid non-string object key: %s", key)) error(`Invalid non-string object key: {key}`)
end end
self:SkipWhiteSpace() self:SkipWhiteSpace()
local ch = self:Next() local ch = self:Next()
if ch ~= ":" then if ch ~= ":" then
error( error(`Invalid object: '{self:All()}' due to: '{ch}'`)
string.format(
"Invalid object: '%s' due to: '%s'",
self:All(),
ch
)
)
end end
self:SkipWhiteSpace() self:SkipWhiteSpace()
local val = self:Read() local val = self:Read()
@ -417,13 +403,7 @@ function JsonReader:ReadObject()
if not done then if not done then
ch = self:Next() ch = self:Next()
if ch ~= "," then if ch ~= "," then
error( error(`Invalid array: '{self:All()}' near: '{ch}'`)
string.format(
"Invalid array: '%s' near: '%s'",
self:All(),
ch
)
)
end end
end end
end end
@ -522,14 +502,16 @@ t.SelectTerrainRegion = function(
if type(regionToSelect) ~= "Region3" then if type(regionToSelect) ~= "Region3" then
error( error(
"regionToSelect (first arg), should be of type Region3, but is type " `regionToSelect (first arg), should be of type Region3, but is type {type(
.. type(regionToSelect) regionToSelect
)}`
) )
end end
if type(color) ~= "BrickColor" then if type(color) ~= "BrickColor" then
error( error(
"color (second arg), should be of type BrickColor, but is type " `color (second arg), should be of type BrickColor, but is type {type(
.. type(color) color
)}`
) )
end end
@ -568,10 +550,14 @@ t.SelectTerrainRegion = function(
-- srs translation from region3 to region3int16 -- srs translation from region3 to region3int16
-- local function Region3ToRegion3int16(region3) -- local function Region3ToRegion3int16(region3)
-- local theLowVec = region3.CFrame.p - (region3.Size / 2) + Vector3.new(2, 2, 2) -- local theLowVec = region3.CFrame.p
-- - (region3.Size / 2)
-- + Vector3.new(2, 2, 2)
-- local lowCell = WorldToCellPreferSolid(terrain, theLowVec) -- local lowCell = WorldToCellPreferSolid(terrain, theLowVec)
-- local theHighVec = region3.CFrame.p + (region3.Size / 2) - Vector3.new(2, 2, 2) -- local theHighVec = region3.CFrame.p
-- + (region3.Size / 2)
-- - Vector3.new(2, 2, 2)
-- local highCell = WorldToCellPreferSolid(terrain, theHighVec) -- local highCell = WorldToCellPreferSolid(terrain, theHighVec)
-- local highIntVec = Vector3int16.new(highCell.x, highCell.y, highCell.z) -- local highIntVec = Vector3int16.new(highCell.x, highCell.y, highCell.z)
@ -960,9 +946,7 @@ local function Create_PrivImpl(objectType)
elseif type(k) == "number" then elseif type(k) == "number" then
if type(v) ~= "userdata" then if type(v) ~= "userdata" then
error( error(
"Bad entry in Create body: Numeric keys must be paired with children, got a: " `Bad entry in Create body: Numeric keys must be paired with children, got a: {v}`
.. type(v),
2
) )
end end
v.Parent = obj v.Parent = obj
@ -971,10 +955,7 @@ local function Create_PrivImpl(objectType)
elseif type(k) == "table" and k.__eventname then elseif type(k) == "table" and k.__eventname then
if type(v) ~= "function" then if type(v) ~= "function" then
error( error(
"Bad entry in Create body: Key `[Create.E'" `Bad entry in Create body: Key \`[Create.E'{k.__eventname}']\` must have a function value, got: {v}`,
.. k.__eventname
.. "']` must have a function value, got: "
.. tostring(v),
2 2
) )
end end
@ -984,8 +965,7 @@ local function Create_PrivImpl(objectType)
elseif k == t.Create then elseif k == t.Create then
if type(v) ~= "function" then if type(v) ~= "function" then
error( error(
"Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: " `Bad entry in Create body: Key \`[Create]\` should be paired with a constructor function, got: {v}`,
.. tostring(v),
2 2
) )
elseif ctor then elseif ctor then
@ -997,14 +977,7 @@ local function Create_PrivImpl(objectType)
end end
ctor = v ctor = v
else else
error( error(`Bad entry ({k} => {v}) in Create body`, 2)
"Bad entry ("
.. tostring(k)
.. " => "
.. tostring(v)
.. ") in Create body",
2
)
end end
end end

View File

@ -1251,9 +1251,7 @@ t.SetupStamperDragger = function(
end end
if not Mouse:IsA "Mouse" then if not Mouse:IsA "Mouse" then
error( error(
"Error: RbxStamper.DoStamperMouseMove: Mouse is of type " `Error: RbxStamper.DoStamperMouseMove: Mouse is of type {Mouse.className} should be of type Mouse`
.. Mouse.className
.. " should be of type Mouse"
) )
return return
end end
@ -1845,8 +1843,7 @@ t.SetupStamperDragger = function(
end end
-- After rotating, update the position -- After rotating, update the position
configFound, targetCFrame = configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData)
findConfigAtMouseTarget(Mouse, stampData)
if configFound then if configFound then
stampData.CurrentParts = stampData.CurrentParts =
positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts)
@ -2566,7 +2563,8 @@ t.SetupStamperDragger = function(
end end
-- if it's a model, we also want to fill in the playerID and playerName tags, if it has those (e.g. for the friend-only door) -- if it's a model, we also want to fill in the playerID and playerName tags, if it has those (e.g. for the friend-only door)
local playerIdTag = stampData.CurrentParts:FindFirstChild "PlayerIdTag" local playerIdTag =
stampData.CurrentParts:FindFirstChild "PlayerIdTag"
local playerNameTag = local playerNameTag =
stampData.CurrentParts:FindFirstChild "PlayerNameTag" stampData.CurrentParts:FindFirstChild "PlayerNameTag"
@ -2804,7 +2802,8 @@ t.SetupStamperDragger = function(
end end
if clone:FindFirstChild("ClusterMaterial", true) then -- extract all info from vector if clone:FindFirstChild("ClusterMaterial", true) then -- extract all info from vector
local clusterMaterial = clone:FindFirstChild("ClusterMaterial", true) local clusterMaterial =
clone:FindFirstChild("ClusterMaterial", true)
if clusterMaterial:IsA "Vector3Value" then if clusterMaterial:IsA "Vector3Value" then
cellInfo.Material = clusterMaterial.Value.X cellInfo.Material = clusterMaterial.Value.X
cellInfo.clusterType = clusterMaterial.Value.Y cellInfo.clusterType = clusterMaterial.Value.Y

View File

@ -773,11 +773,11 @@ function getGearContextMenu()
local element = contextElement local element = contextElement
if element.Type == "Button" then if element.Type == "Button" then
local button = Instance.new "TextButton" local button = Instance.new "TextButton"
button.Name = "UnequipContextButton" .. i button.Name = `UnequipContextButton{i}`
button.BackgroundColor3 = Color3.new(0, 0, 0) button.BackgroundColor3 = Color3.new(0, 0, 0)
button.BorderSizePixel = 0 button.BorderSizePixel = 0
button.TextXAlignment = Enum.TextXAlignment.Left button.TextXAlignment = Enum.TextXAlignment.Left
button.Text = " " .. contextElement.Text button.Text = ` {contextElement.Text}`
button.Font = Enum.Font.Arial button.Font = Enum.Font.Arial
button.FontSize = Enum.FontSize.Size14 button.FontSize = Enum.FontSize.Size14
button.Size = UDim2.new(1, 8, 0, elementHeight) button.Size = UDim2.new(1, 8, 0, elementHeight)
@ -815,7 +815,7 @@ function getGearContextMenu()
contextElement.Element = button contextElement.Element = button
elseif element.Type == "Label" then elseif element.Type == "Label" then
local frame = Instance.new "Frame" local frame = Instance.new "Frame"
frame.Name = "ContextLabel" .. i frame.Name = `ContextLabel{i}`
frame.BackgroundTransparency = 1 frame.BackgroundTransparency = 1
frame.Size = UDim2.new(1, 8, 0, elementHeight) frame.Size = UDim2.new(1, 8, 0, elementHeight)

View File

@ -83,7 +83,7 @@ do
end, end,
}, },
__tostring = function(self) __tostring = function(self)
return "Enum." .. self[EnumName] return `Enum.{self[EnumName]}`
end, end,
} }
local item_mt = { local item_mt = {
@ -91,7 +91,7 @@ do
return value == self or value == self.Name or value == self.Value return value == self or value == self.Name or value == self.Value
end, end,
__tostring = function(self) __tostring = function(self)
return "Enum." .. self[EnumName] .. "." .. self.Name return `Enum.{self[EnumName]}.{self.Name}`
end, end,
} }
CreateEnum = function(enumName) CreateEnum = function(enumName)
@ -179,11 +179,45 @@ local Chat = {
Messages_List = {}, Messages_List = {},
MessageThread = nil, MessageThread = nil,
--[[ Admins_List = {'Sorcus', 'Shedletsky', 'Telamon', 'Tarabyte', 'StickMasterLuke', 'OnlyTwentyCharacters', 'FusRoblox', 'SolarCrane', -- Admins_List = {
'HotThoth', 'JediTkacheff', 'Builderman', 'Brighteyes', 'ReeseMcblox', 'GemLocker', 'GongfuTiger', 'Erik.Cassel', 'Matt Dusek', 'Keith', -- "Sorcus",
'Totbl', 'LordRugDump', 'David.Baszucki', 'Dbapostle', 'DaveYorkRBX', 'nJay', 'OstrichSized', 'TobotRobot', 'twberg', 'Mercury', 'RBAdam', 'Doughtless', -- "Shedletsky",
'Anaminus', 'Stravant', 'Cr3470r', 'CodeWriter', 'Games', 'AcesWayUpHigh', 'Phil' -- "Telamon",
}, --]] -- "Tarabyte",
-- "StickMasterLuke",
-- "OnlyTwentyCharacters",
-- "FusRoblox",
-- "SolarCrane",
-- "HotThoth",
-- "JediTkacheff",
-- "Builderman",
-- "Brighteyes",
-- "ReeseMcblox",
-- "GemLocker",
-- "GongfuTiger",
-- "Erik.Cassel",
-- "Matt Dusek",
-- "Keith",
-- "Totbl",
-- "LordRugDump",
-- "David.Baszucki",
-- "Dbapostle",
-- "DaveYorkRBX",
-- "nJay",
-- "OstrichSized",
-- "TobotRobot",
-- "twberg",
-- "Mercury",
-- "RBAdam",
-- "Doughtless",
-- "Anaminus",
-- "Stravant",
-- "Cr3470r",
-- "CodeWriter",
-- "Games",
-- "AcesWayUpHigh",
-- "Phil",
-- },
Admins_List = { "taskmanager", "Heliodex", "tako" }, Admins_List = { "taskmanager", "Heliodex", "tako" },
SafeChat_List = { SafeChat_List = {
@ -990,21 +1024,23 @@ end
-- Scrolling -- Scrolling
-- function Chat:ScrollQueue(value) -- function Chat:ScrollQueue(value)
-- --[[for i = 1, #self.MessageQueue do -- for i = 1, #self.MessageQueue do
-- if self.MessageQueue[i] then -- if self.MessageQueue[i] then
-- for _, label in pairs(self.MessageQueue[i]) do -- for _, label in pairs(self.MessageQueue[i]) do
-- local next = self.MessageQueue[i].Next -- local next = self.MessageQueue[i].Next
-- local previous = self.MessageQueue[i].Previous -- local previous = self.MessageQueue[i].Previous
-- if label and label:IsA('TextLabel') or label:IsA('TextButton') then -- if
-- label and label:IsA "TextLabel" or label:IsA "TextButton"
-- then
-- if value > 0 and previous and previous.Message then -- if value > 0 and previous and previous.Message then
-- label.Position = previous['Message'].Position -- label.Position = previous["Message"].Position
-- elseif value < 1 and next.Message then -- elseif value < 1 and next.Message then
-- label.Position = previous['Message'].Position -- label.Position = previous["Message"].Position
-- end
-- end -- end
-- end -- end
-- end -- end
-- end -- end
-- end ]]
-- end -- end
-- Handles the rendering of the text objects in their appropriate places -- Handles the rendering of the text objects in their appropriate places
@ -1119,10 +1155,10 @@ function Chat:ComputeSpaceString(pLabel)
end end
while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do
nString = nString .. " " nString ..= " "
self.TempSpaceLabel.Text = nString self.TempSpaceLabel.Text = nString
end end
nString = nString .. " " nString ..= " "
self.CachedSpaceStrings_List[pLabel.Text] = nString self.CachedSpaceStrings_List[pLabel.Text] = nString
self.TempSpaceLabel.Text = "" self.TempSpaceLabel.Text = ""
return nString return nString
@ -1194,10 +1230,10 @@ function Chat:CreateMessage(cPlayer, message)
-- If we ever hit the mark, which would be in every popular game btw -- If we ever hit the mark, which would be in every popular game btw
-- we wrap around and reuse the labels -- we wrap around and reuse the labels
if #self.MessageQueue > self.Configuration.HistoryLength then if #self.MessageQueue > self.Configuration.HistoryLength then
--[[pLabel = self.MessageQueue[#self.MessageQueue]['Player'] --[[pLabel = self.MessageQueue[#self.MessageQueue]["Player"]
mLabel = self.MessageQueue[#self.MessageQueue]['Message'] mLabel = self.MessageQueue[#self.MessageQueue]["Message"]
pLabel.Text = pName .. ':' pLabel.Text = `{pName}:`
pLabel.Name = pName pLabel.Name = pName
local pColor local pColor
@ -1216,14 +1252,14 @@ function Chat:CreateMessage(cPlayer, message)
end end
mLabel.Text = "" mLabel.Text = ""
mLabel.Name = pName .. " - message" mLabel.Name = `{pName} - message`
mLabel.Text = nString .. message; mLabel.Text = nString .. message
mLabel.Parent = nil mLabel.Parent = nil
mLabel.Parent = self.RenderFrame mLabel.Parent = self.RenderFrame
mLabel.Position = UDim2.new(0, 0, 1, 0); mLabel.Position = UDim2.new(0, 0, 1, 0)
pLabel.Position = UDim2.new(0, 0, 1, 0);]] pLabel.Position = UDim2.new(0, 0, 1, 0)]]
-- Reinserted at the beginning, ring buffer -- Reinserted at the beginning, ring buffer
self.MessageQueue[#self.MessageQueue] = nil self.MessageQueue[#self.MessageQueue] = nil
@ -1232,7 +1268,7 @@ function Chat:CreateMessage(cPlayer, message)
-- Haven't hit the mark yet, so keep creating -- Haven't hit the mark yet, so keep creating
pLabel = Gui.Create "TextLabel" { pLabel = Gui.Create "TextLabel" {
Name = pName, Name = pName,
Text = pName .. ":", Text = `{pName}:`,
-- TextColor3 = pColor, -- TextColor3 = pColor,
FontSize = Chat.Configuration.FontSize, FontSize = Chat.Configuration.FontSize,
TextXAlignment = Enum.TextXAlignment.Left, TextXAlignment = Enum.TextXAlignment.Left,
@ -1263,7 +1299,7 @@ function Chat:CreateMessage(cPlayer, message)
end end
mLabel = Gui.Create "TextLabel" { mLabel = Gui.Create "TextLabel" {
Name = pName .. " - message", Name = `{pName} - message`,
-- Max is 3 lines -- Max is 3 lines
Size = UDim2.new(1, 0, 0.5, 0), Size = UDim2.new(1, 0, 0.5, 0),
TextColor3 = Chat.Configuration.MessageColor, TextColor3 = Chat.Configuration.MessageColor,

View File

@ -52,15 +52,11 @@ function onDied(victim, humanoid)
local victorId = 0 local victorId = 0
if killer then if killer then
victorId = killer.userId victorId = killer.userId
print("STAT: kill by " .. victorId .. " of " .. victim.userId) print(`STAT: kill by {victorId} of {victim.userId}`)
game:HttpGet( game:HttpGet(`{url}/Game/Knockouts.ashx?UserID={victorId}&{access}`)
url .. "/Game/Knockouts.ashx?UserID=" .. victorId .. "&" .. access
)
end end
print("STAT: death of " .. victim.userId .. " by " .. victorId) print(`STAT: death of {victim.userId} by {victorId}`)
game:HttpGet( game:HttpGet(`{url}/Game/Wipeouts.ashx?UserID={victim.userId}&{access}`)
url .. "/Game/Wipeouts.ashx?UserID=" .. victim.userId .. "&" .. access
)
end end
-----------------------------------END UTILITY FUNCTIONS ------------------------- -----------------------------------END UTILITY FUNCTIONS -------------------------
@ -104,75 +100,61 @@ local ns = game:GetService "NetworkServer"
if url ~= nil then if url ~= nil then
pcall(function() pcall(function()
game:GetService("Players"):SetAbuseReportUrl( game:GetService("Players"):SetAbuseReportUrl(`{url}/Report/Games.ashx`)
url .. "/Report/Games.ashx"
)
end) end)
pcall(function() pcall(function()
game:GetService("ScriptInformationProvider") game:GetService("ScriptInformationProvider"):SetAssetUrl(`{url}/Asset/`)
:SetAssetUrl(url .. "/Asset/")
end) end)
pcall(function() pcall(function()
game:GetService("ContentProvider"):SetBaseUrl(url .. "/") game:GetService("ContentProvider"):SetBaseUrl(`{url}/`)
end) end)
-- pcall(function() game:GetService("Players"):SetChatFilterUrl(url .. "/Game/ChatFilter.ashx") end) -- pcall(function()
-- game:GetService("Players"):SetChatFilterUrl(
-- `{url}/Game/ChatFilter.ashx`
-- )
-- end)
-- BadgeService:SetPlaceId(placeId) -- BadgeService:SetPlaceId(placeId)
if access ~= nil then if access ~= nil then
BadgeService:SetAwardBadgeUrl( BadgeService:SetAwardBadgeUrl(
url `{url}/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&{access}`
.. "/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&"
.. access
) )
BadgeService:SetHasBadgeUrl( BadgeService:SetHasBadgeUrl(
url .. "/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&" .. access `{url}/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&{access}`
) )
BadgeService:SetIsBadgeDisabledUrl( BadgeService:SetIsBadgeDisabledUrl(
url `{url}/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&{access}`
.. "/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&"
.. access
) )
FriendService:SetMakeFriendUrl( FriendService:SetMakeFriendUrl(
servicesUrl `{servicesUrl}/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&{access}`
.. "/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&"
.. access
) )
FriendService:SetBreakFriendUrl( FriendService:SetBreakFriendUrl(
servicesUrl `{servicesUrl}/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&{access}`
.. "/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&"
.. access
) )
FriendService:SetGetFriendsUrl( FriendService:SetGetFriendsUrl(
servicesUrl .. "/Friend/AreFriends?userId=%d&" .. access `{servicesUrl}/Friend/AreFriends?userId={access}`
) )
end end
BadgeService:SetIsBadgeLegalUrl "" BadgeService:SetIsBadgeLegalUrl ""
InsertService InsertService:SetBaseSetsUrl(
:SetBaseSetsUrl( `{url}/Game/Tools/InsertAsset.ashx?nsets=10&type=base`
url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base"
) )
InsertService:SetUserSetsUrl( InsertService:SetUserSetsUrl(
url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d" `{url}/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d`
) )
InsertService InsertService:SetCollectionUrl(`{url}/Game/Tools/InsertAsset.ashx?sid=%d`)
:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d") InsertService:SetAssetUrl(`{url}/Asset/?id=%d`)
InsertService:SetAssetUrl(url .. "/Asset/?id=%d") InsertService:SetAssetVersionUrl(`{url}/Asset/?assetversionid=%d`)
InsertService
:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d")
pcall(function() pcall(function()
loadfile(url .. "/Game/LoadPlaceInfo.ashx?PlaceId=" .. placeId)() loadfile(`{url}/Game/LoadPlaceInfo.ashx?PlaceId={placeId}`)()
end) end)
pcall(function() pcall(function()
if access then if access then
loadfile( loadfile(
url `{url}/Game/PlaceSpecificScript.ashx?PlaceId={placeId}&{access}`
.. "/Game/PlaceSpecificScript.ashx?PlaceId="
.. placeId
.. "&"
.. access
)() )()
end end
end) end)
@ -213,42 +195,24 @@ if placeId ~= nil and killID ~= nil and deathID ~= nil and url ~= nil then
end end
game:GetService("Players").PlayerAdded:connect(function(player) game:GetService("Players").PlayerAdded:connect(function(player)
print("Player " .. player.userId .. " added") print(`Player {player.userId} added`)
if url and access and placeId and player and player.userId then if url and access and placeId and player and player.userId then
game:HttpGet( game:HttpGet(
url `{url}/Game/ClientPresence.ashx?action=connect&{access}&PlaceID={placeId}&UserID={player.userId}`
.. "/Game/ClientPresence.ashx?action=connect&"
.. access
.. "&PlaceID="
.. placeId
.. "&UserID="
.. player.userId
) )
game:HttpGet( game:HttpGet(
url `{url}/Game/PlaceVisit.ashx?UserID={player.userId}&AssociatedPlaceID={placeId}&{access}`
.. "/Game/PlaceVisit.ashx?UserID="
.. player.userId
.. "&AssociatedPlaceID="
.. placeId
.. "&"
.. access
) )
end end
end) end)
game:GetService("Players").PlayerRemoving:connect(function(player) game:GetService("Players").PlayerRemoving:connect(function(player)
print("Player " .. player.userId .. " leaving") print(`Player {player.userId} leaving`)
if url and access and placeId and player and player.userId then if url and access and placeId and player and player.userId then
game:HttpGet( game:HttpGet(
url `{url}/Game/ClientPresence.ashx?action=disconnect&{access}&PlaceID={placeId}&UserID={player.userId}`
.. "/Game/ClientPresence.ashx?action=disconnect&"
.. access
.. "&PlaceID="
.. placeId
.. "&UserID="
.. player.userId
) )
end end
end) end)
@ -258,7 +222,7 @@ if placeId ~= nil and url ~= nil then
wait() wait()
-- load the game -- load the game
game:Load(url .. "/asset/?id=" .. placeId) game:Load(`{url}/asset/?id={placeId}`)
end end
if _MAP_LOCATION_EXISTS then if _MAP_LOCATION_EXISTS then
@ -280,17 +244,15 @@ end
ScriptContext.ScriptsDisabled = false ScriptContext.ScriptsDisabled = false
-- delay(1, function() -- delay(1, function()
-- loadfile(url .. "/analytics/GamePerfMonitor.ashx")(game.JobId, placeId) -- loadfile(`{url}/analytics/GamePerfMonitor.ashx`)(game.JobId, placeId)
-- end) -- end)
-- yimy stuff -- yimy stuff
local reset = ";mc" local reset = ";mc"
game.Players.PlayerAdded:connect(function(player) game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg) player.Chatted:connect(function(msg)
if msg == reset then if msg == reset and player.Character then
if player.Character then
player.Character.Humanoid.Health = 0 player.Character.Humanoid.Health = 0
end end
end
end) end)
end) end)

View File

@ -193,10 +193,10 @@ function onConnectionAccepted(_, replicator)
end end
-- called when the client connection fails -- called when the client connection fails
function onConnectionFailed(_, error) function onConnectionFailed(_, err)
showErrorWindow( showErrorWindow(
"Failed to connect to the Game. (ID=" .. error .. ")", `Failed to connect to the Game. (ID={err})`,
"ID" .. error, `ID{err}`,
"Other" "Other"
) )
end end
@ -212,12 +212,12 @@ function onConnectionRejected()
end end
local idled = false local idled = false
function onPlayerIdled(time) function onPlayerIdled(idleTime)
if time > 20 * 60 then if idleTime > 20 * 60 then
showErrorWindow( showErrorWindow(
string.format( string.format(
"You were disconnected for being idle %d minutes", "You were disconnected for being idle %d minutes",
time / 60 idleTime / 60
), ),
"Idle", "Idle",
"Idle" "Idle"

View File

@ -14,36 +14,23 @@ local ScriptContext = game:GetService "ScriptContext"
pcall(function() pcall(function()
ContentProvider:SetBaseUrl(baseUrl) ContentProvider:SetBaseUrl(baseUrl)
InsertService:SetAssetUrl(baseUrl .. "/asset?id=%d") InsertService:SetAssetUrl(`{baseUrl}/asset?id=%d`)
InsertService:SetAssetVersionUrl(baseUrl .. "/asset?assetversionid=%d") InsertService:SetAssetVersionUrl(`{baseUrl}/asset?assetversionid=%d`)
end) end)
HttpService.HttpEnabled = true HttpService.HttpEnabled = true
ScriptContext.ScriptsDisabled = true ScriptContext.ScriptsDisabled = true
print( print(`[{game.JobId}] Starting new render for {renderType} ID {assetId}`)
"["
.. game.JobId
.. "] Starting new render for "
.. renderType
.. " ID "
.. assetId
)
game:HttpPost( game:HttpPost(
baseUrl `{baseUrl}/api/render/update?apiKey={thumbnailKey}&amp;taskID={game.JobId}`,
.. "/api/render/update?apiKey="
.. thumbnailKey
.. "&amp;taskID="
.. game.JobId,
"Rendering", "Rendering",
true, true,
"text/json" "text/json"
) )
local player = game:GetService("Players"):CreateLocalPlayer(0) local player = game:GetService("Players"):CreateLocalPlayer(0)
player.CharacterAppearance = baseUrl player.CharacterAppearance = `{baseUrl}/asset/characterfetch?userID={assetId}`
.. "/asset/characterfetch?userID="
.. assetId
player:LoadCharacter(false) player:LoadCharacter(false)
-- Raise up the character's arm if they have gear. -- Raise up the character's arm if they have gear.
@ -55,7 +42,7 @@ end
local clickBody = ThumbnailGenerator:Click("PNG", 2048, 2048, true) local clickBody = ThumbnailGenerator:Click("PNG", 2048, 2048, true)
print("[" .. game.JobId .. "] Rendered bodyshot") print(`[{game.JobId}] Rendered bodyshot`)
player.Character.Torso["Right Shoulder"].CurrentAngle = 0 player.Character.Torso["Right Shoulder"].CurrentAngle = 0
@ -76,44 +63,25 @@ workspace.CurrentCamera = Camera
local clickHead = ThumbnailGenerator:Click("PNG", 300, 300, true) local clickHead = ThumbnailGenerator:Click("PNG", 300, 300, true)
local result = "Completed\n" local result = `Completed\n{clickBody}\n{clickHead}`
.. tostring(clickBody)
.. "\n"
.. tostring(clickHead)
print("[" .. game.JobId .. "] Rendered headshot") print(`[{game.JobId}] Rendered headshot`)
for i = 1, 3 do for i = 1, 3 do
local ok, err = pcall(function() local ok, err = pcall(function()
game:HttpPost( game:HttpPost(
baseUrl `{baseUrl}/api/render/update?apiKey={thumbnailKey}&amp;taskID={game.JobId}`,
.. "/api/render/update?apiKey="
.. thumbnailKey
.. "&amp;taskID="
.. game.JobId,
result, result,
true, true,
"text/json" "text/json"
) )
end) end)
if ok then if ok then
print("[" .. game.JobId .. "] Upload successful! Moving on...") print(`[{game.JobId}] Upload successful! Moving on...`)
break break
elseif i == 3 then elseif i == 3 then
print( print(`[{game.JobId}] An error occurred! ({err}). Giving up...`)
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Giving up..."
)
break break
end end
print( print(`[{game.JobId}] An error occurred! ({err}). Uploading again...`)
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Uploading again..."
)
end end

View File

@ -14,36 +14,23 @@ local ScriptContext = game:GetService "ScriptContext"
pcall(function() pcall(function()
ContentProvider:SetBaseUrl(baseUrl) ContentProvider:SetBaseUrl(baseUrl)
InsertService:SetAssetUrl(baseUrl .. "/asset?id=%d") InsertService:SetAssetUrl(`{baseUrl}/asset?id=%d`)
InsertService:SetAssetVersionUrl(baseUrl .. "/asset?assetversionid=%d") InsertService:SetAssetVersionUrl(`{baseUrl}/asset?assetversionid=%d`)
end) end)
HttpService.HttpEnabled = true HttpService.HttpEnabled = true
ScriptContext.ScriptsDisabled = true ScriptContext.ScriptsDisabled = true
print( print(`[{game.JobId}] Starting new render for {renderType} ID {assetId}`)
"["
.. game.JobId
.. "] Starting new render for "
.. renderType
.. " ID "
.. assetId
)
game:HttpPost( game:HttpPost(
baseUrl `{baseUrl}/api/render/update?apiKey={thumbnailKey}&amp;taskID={game.JobId}`,
.. "/api/render/update?apiKey="
.. thumbnailKey
.. "&amp;taskID="
.. game.JobId,
"Rendering", "Rendering",
true, true,
"text/json" "text/json"
) )
local player = game:GetService("Players"):CreateLocalPlayer(0) local player = game:GetService("Players"):CreateLocalPlayer(0)
player.CharacterAppearance = baseUrl player.CharacterAppearance = `{baseUrl}/api/render/characterasset?id={assetId}`
.. "/api/render/characterasset?id="
.. assetId
player:LoadCharacter(false) player:LoadCharacter(false)
-- Raise up the character's arm if they have gear. -- Raise up the character's arm if they have gear.
@ -56,39 +43,23 @@ end
local click = ThumbnailGenerator:Click("PNG", 2048, 2048, true) local click = ThumbnailGenerator:Click("PNG", 2048, 2048, true)
local result = "Completed\n" .. tostring(click) local result = "Completed\n" .. tostring(click)
print("[" .. game.JobId .. "] Successfully rendered, moving on...") print(`[{game.JobId}] Successfully rendered, moving on...`)
for i = 1, 3 do for i = 1, 3 do
local ok, err = pcall(function() local ok, err = pcall(function()
game:HttpPost( game:HttpPost(
baseUrl `{baseUrl}/api/render/update?apiKey={thumbnailKey}&amp;taskID={game.JobId}`,
.. "/api/render/update?apiKey="
.. thumbnailKey
.. "&amp;taskID="
.. game.JobId,
result, result,
true, true,
"text/json" "text/json"
) )
end) end)
if ok then if ok then
print("[" .. game.JobId .. "] Upload successful! Moving on...") print(`[{game.JobId}] Upload successful! Moving on...`)
break break
elseif i == 3 then elseif i == 3 then
print( print(`[{game.JobId}] An error occurred! ({err}). Giving up...`)
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Giving up..."
)
break break
end end
print( print(`[{game.JobId}] An error occurred! ({err}). Uploading again...`)
"["
.. game.JobId
.. "] An error occurred! ("
.. err
.. "). Uploading again..."
)
end end