Regenerate Luau definitions file and derive site domain from ContentProvider.BaseUrl
This commit is contained in:
parent
f732e55073
commit
333fda23d1
|
|
@ -1,4 +1,7 @@
|
||||||
--!strict
|
--!strict
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
local Load = {}
|
local Load = {}
|
||||||
|
|
||||||
function Load.Help()
|
function Load.Help()
|
||||||
|
|
@ -6,7 +9,7 @@ function Load.Help()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Load.Start(ticket: string)
|
function Load.Start(ticket: string)
|
||||||
dofile("http://banland.xyz/game/host?ticket=" .. ticket)
|
dofile(path "game/host?ticket=" .. ticket)
|
||||||
end
|
end
|
||||||
|
|
||||||
return Load
|
return Load
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,15 @@
|
||||||
|
--!strict
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
|
|
||||||
|
-- remove www
|
||||||
|
local url = string.gsub(ContentProvider.BaseUrl, "www.", "")
|
||||||
|
|
||||||
|
local BaseUrl = {
|
||||||
|
url = url,
|
||||||
|
}
|
||||||
|
|
||||||
|
function BaseUrl.path(path: string)
|
||||||
|
return url .. path
|
||||||
|
end
|
||||||
|
|
||||||
|
return BaseUrl
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ function TweenInfo.new(
|
||||||
repeatCount: number?,
|
repeatCount: number?,
|
||||||
reverses: boolean?,
|
reverses: boolean?,
|
||||||
delayTime: number?
|
delayTime: number?
|
||||||
)
|
): FakeTweenInfo
|
||||||
local proxy = newproxy(true)
|
local proxy = newproxy(true)
|
||||||
local mt = getmetatable(proxy)
|
local mt = getmetatable(proxy)
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ function TweenInfo.new(
|
||||||
|
|
||||||
-- When attempting to assign to properties, throw an error
|
-- When attempting to assign to properties, throw an error
|
||||||
mt.__newindex = function(_, prop)
|
mt.__newindex = function(_, prop)
|
||||||
error(prop .. " cannot be assigned to", math.huge) -- lmfao
|
error(prop .. " cannot be assigned to", 99)
|
||||||
end
|
end
|
||||||
|
|
||||||
mt.__tostring = function()
|
mt.__tostring = function()
|
||||||
|
|
|
||||||
3092
defs.d.lua
3092
defs.d.lua
File diff suppressed because it is too large
Load Diff
|
|
@ -6,6 +6,8 @@ local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
|
||||||
|
local CoreGui = game:GetService "CoreGui"
|
||||||
|
local Chat = game:GetService "Chat"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
|
|
||||||
|
|
@ -42,14 +44,13 @@ local player, chatNotificationGui, messageDialog, timeoutScript, reenableDialogS
|
||||||
local dialogMap = {}
|
local dialogMap = {}
|
||||||
local dialogConnections = {}
|
local dialogConnections = {}
|
||||||
|
|
||||||
local gui
|
|
||||||
waitForChild(game, "CoreGui")
|
waitForChild(game, "CoreGui")
|
||||||
waitForChild(game.CoreGui, "RobloxGui")
|
waitForChild(CoreGui, "RobloxGui")
|
||||||
if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then
|
|
||||||
gui = game.CoreGui.RobloxGui.ControlFrame
|
local MercuryGui = CoreGui:FindFirstChild "RobloxGui" :: ScreenGui & {
|
||||||
else
|
ControlFrame: Frame,
|
||||||
gui = game.CoreGui.RobloxGui
|
}
|
||||||
end
|
local gui = MercuryGui:FindFirstChild "ControlFrame" or MercuryGui
|
||||||
|
|
||||||
local function currentTone()
|
local function currentTone()
|
||||||
if currentConversationDialog then
|
if currentConversationDialog then
|
||||||
|
|
@ -333,7 +334,7 @@ local function selectChoice(choice)
|
||||||
--First hide the Gui
|
--First hide the Gui
|
||||||
mainFrame.Visible = false
|
mainFrame.Visible = false
|
||||||
if choice == lastChoice then
|
if choice == lastChoice then
|
||||||
game.Chat:Chat(
|
Chat:Chat(
|
||||||
localPlayer.Character,
|
localPlayer.Character,
|
||||||
"Goodbye!",
|
"Goodbye!",
|
||||||
getChatColor(currentTone())
|
getChatColor(currentTone())
|
||||||
|
|
@ -343,7 +344,7 @@ local function selectChoice(choice)
|
||||||
else
|
else
|
||||||
local dialogChoice = choiceMap[choice]
|
local dialogChoice = choiceMap[choice]
|
||||||
|
|
||||||
game.Chat:Chat(
|
Chat:Chat(
|
||||||
localPlayer.Character,
|
localPlayer.Character,
|
||||||
sanitiseMessage(dialogChoice.UserDialog),
|
sanitiseMessage(dialogChoice.UserDialog),
|
||||||
getChatColor(currentTone())
|
getChatColor(currentTone())
|
||||||
|
|
@ -353,7 +354,7 @@ local function selectChoice(choice)
|
||||||
player,
|
player,
|
||||||
dialogChoice
|
dialogChoice
|
||||||
)
|
)
|
||||||
game.Chat:Chat(
|
Chat:Chat(
|
||||||
currentConversationPartner,
|
currentConversationPartner,
|
||||||
sanitiseMessage(dialogChoice.ResponseDialog),
|
sanitiseMessage(dialogChoice.ResponseDialog),
|
||||||
getChatColor(currentTone())
|
getChatColor(currentTone())
|
||||||
|
|
@ -447,8 +448,8 @@ local function initialize(parent)
|
||||||
lastChoice.Parent = mainFrame
|
lastChoice.Parent = mainFrame
|
||||||
end
|
end
|
||||||
|
|
||||||
local function doDialog(dialog)
|
local function doDialog(dialog: Dialog)
|
||||||
local il = Instance.Lock(dialog, player)
|
local il = Instance.Lock(dialog, player) -- does this even do anything in 2013
|
||||||
print("for instance", il)
|
print("for instance", il)
|
||||||
while not il do
|
while not il do
|
||||||
RunService.Heartbeat:wait()
|
RunService.Heartbeat:wait()
|
||||||
|
|
@ -467,7 +468,7 @@ local function doDialog(dialog)
|
||||||
Instance.Unlock(dialog)
|
Instance.Unlock(dialog)
|
||||||
|
|
||||||
currentConversationDialog = dialog
|
currentConversationDialog = dialog
|
||||||
game.Chat:Chat(
|
Chat:Chat(
|
||||||
dialog.Parent,
|
dialog.Parent,
|
||||||
dialog.InitialPrompt,
|
dialog.InitialPrompt,
|
||||||
getChatColor(dialog.Tone)
|
getChatColor(dialog.Tone)
|
||||||
|
|
@ -534,7 +535,7 @@ local function addDialog(dialog: Dialog)
|
||||||
Enabled = not dialog.InUse,
|
Enabled = not dialog.InUse,
|
||||||
Adornee = dialog.Parent,
|
Adornee = dialog.Parent,
|
||||||
RobloxLocked = true,
|
RobloxLocked = true,
|
||||||
Parent = game.CoreGui,
|
Parent = CoreGui,
|
||||||
}
|
}
|
||||||
chatGui.Image.Button.MouseButton1Click:connect(function()
|
chatGui.Image.Button.MouseButton1Click:connect(function()
|
||||||
startDialog(dialog)
|
startDialog(dialog)
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,16 @@
|
||||||
-- RbxGui
|
-- RbxGui
|
||||||
print "[Mercury]: Loaded corescript 45284430"
|
print "[Mercury]: Loaded corescript 45284430"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
|
||||||
local New = News.New
|
|
||||||
local Hydrate = News.Hydrate
|
|
||||||
|
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
|
|
||||||
|
local News = require "../Modules/New"
|
||||||
|
local New = News.New
|
||||||
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
local RbxGui = {}
|
local RbxGui = {}
|
||||||
|
|
||||||
local function ScopedConnect(
|
local function ScopedConnect(
|
||||||
|
|
@ -230,13 +232,13 @@ function RbxGui.CreateStyledMessageDialog(title, message, style, buttons)
|
||||||
|
|
||||||
if style == "error" or style == "Error" then
|
if style == "error" or style == "Error" then
|
||||||
styleImage.Size = UDim2.new(0, 71, 0, 71)
|
styleImage.Size = UDim2.new(0, 71, 0, 71)
|
||||||
styleImage.Image = "http://banland.xyz/asset?id=42565285"
|
styleImage.Image = path "asset?id=42565285"
|
||||||
elseif style == "notify" or style == "Notify" then
|
elseif style == "notify" or style == "Notify" then
|
||||||
styleImage.Size = UDim2.new(0, 71, 0, 71)
|
styleImage.Size = UDim2.new(0, 71, 0, 71)
|
||||||
styleImage.Image = "http://banland.xyz/asset?id=42604978"
|
styleImage.Image = path "asset?id=42604978"
|
||||||
elseif style == "confirm" or style == "Confirm" then
|
elseif style == "confirm" or style == "Confirm" then
|
||||||
styleImage.Size = UDim2.new(0, 74, 0, 76)
|
styleImage.Size = UDim2.new(0, 74, 0, 76)
|
||||||
styleImage.Image = "http://banland.xyz/asset?id=42557901"
|
styleImage.Image = path "asset?id=42557901"
|
||||||
else
|
else
|
||||||
return RbxGui.CreateMessageDialog(title, message, buttons)
|
return RbxGui.CreateMessageDialog(title, message, buttons)
|
||||||
end
|
end
|
||||||
|
|
@ -280,7 +282,7 @@ function RbxGui.CreateDropDownMenu(
|
||||||
New "ImageLabel" {
|
New "ImageLabel" {
|
||||||
Name = "Icon",
|
Name = "Icon",
|
||||||
Active = false,
|
Active = false,
|
||||||
Image = "http://banland.xyz/asset?id=45732894",
|
Image = path "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),
|
||||||
|
|
@ -944,8 +946,8 @@ function RbxGui.CreateSlider(steps: number, width: number, position)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RbxGui.CreateTrueScrollingFrame()
|
function RbxGui.CreateTrueScrollingFrame()
|
||||||
local lowY
|
local lowY: number?
|
||||||
local highY
|
local highY: number?
|
||||||
|
|
||||||
local dragCon: RBXScriptConnection?
|
local dragCon: RBXScriptConnection?
|
||||||
local upCon: RBXScriptConnection?
|
local upCon: RBXScriptConnection?
|
||||||
|
|
@ -1575,7 +1577,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
|
||||||
local scrollStamp = 0
|
local scrollStamp = 0
|
||||||
|
|
||||||
local scrollDrag = New "ImageButton" {
|
local scrollDrag = New "ImageButton" {
|
||||||
Image = "http://banland.xyz/asset?id=61367186",
|
Image = path "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",
|
||||||
|
|
@ -3014,7 +3016,7 @@ function RbxGui.CreateSetPanel(
|
||||||
New "ImageLabel" {
|
New "ImageLabel" {
|
||||||
Name = "CancelImage",
|
Name = "CancelImage",
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=54135717",
|
Image = path "asset?id=54135717",
|
||||||
Position = UDim2.new(0, -2, 0, -2),
|
Position = UDim2.new(0, -2, 0, -2),
|
||||||
Size = UDim2.new(0, 16, 0, 16),
|
Size = UDim2.new(0, 16, 0, 16),
|
||||||
ZIndex = 6,
|
ZIndex = 6,
|
||||||
|
|
@ -3254,7 +3256,7 @@ function RbxGui.CreateSetPanel(
|
||||||
local function createDropDownMenuButton(parent: Frame)
|
local function createDropDownMenuButton(parent: Frame)
|
||||||
local dropDownButton = New "ImageButton" {
|
local dropDownButton = New "ImageButton" {
|
||||||
Name = "DropDownButton",
|
Name = "DropDownButton",
|
||||||
Image = "http://banland.xyz/asset?id=67581509",
|
Image = path "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),
|
||||||
|
|
@ -3767,8 +3769,9 @@ function RbxGui.CreateTerrainMaterialSelector(size, position)
|
||||||
toAdd = 66887593
|
toAdd = 66887593
|
||||||
end
|
end
|
||||||
|
|
||||||
materialToImageMap[v] =
|
materialToImageMap[v] = {
|
||||||
{ Regular = `http://banland.xyz/asset?id={toAdd}` }
|
Regular = path "asset?id=" .. toAdd,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local scrollFrame, scrollUp, scrollDown, recalculateScroll =
|
local scrollFrame, scrollUp, scrollDown, recalculateScroll =
|
||||||
|
|
@ -3879,7 +3882,7 @@ function RbxGui.CreateTerrainMaterialSelector(size, position)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RbxGui.CreateLoadingFrame(name, size, position)
|
function RbxGui.CreateLoadingFrame(name, size, position)
|
||||||
ContentProvider:Preload "http://banland.xyz/asset?id=35238053"
|
ContentProvider:Preload(path "asset?id=35238053")
|
||||||
|
|
||||||
local loadingFrame = New "Frame" {
|
local loadingFrame = New "Frame" {
|
||||||
Name = "LoadingFrame",
|
Name = "LoadingFrame",
|
||||||
|
|
@ -3911,7 +3914,7 @@ function RbxGui.CreateLoadingFrame(name, size, position)
|
||||||
|
|
||||||
local loadingGreenBar = New "ImageLabel" {
|
local loadingGreenBar = New "ImageLabel" {
|
||||||
Name = "LoadingGreenBar",
|
Name = "LoadingGreenBar",
|
||||||
Image = "http://banland.xyz/asset?id=35238053",
|
Image = path "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,
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,20 @@
|
||||||
-- CoreGui.RobloxGui.CoreScripts/Settings
|
-- CoreGui.RobloxGui.CoreScripts/Settings
|
||||||
print "[Mercury]: Loaded corescript 46295863"
|
print "[Mercury]: Loaded corescript 46295863"
|
||||||
|
|
||||||
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
local CoreGui = game:GetService "CoreGui"
|
local path = BaseUrl.path
|
||||||
local GuiService = game:GetService "GuiService"
|
|
||||||
local Players = game:GetService "Players"
|
|
||||||
|
|
||||||
local function waitForChild(instance, name)
|
local function waitForChild(instance, name)
|
||||||
while not instance:FindFirstChild(name) do
|
while not instance:FindFirstChild(name) do
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function waitForProperty(instance, property)
|
local function waitForProperty(instance, property)
|
||||||
while not instance[property] do
|
while not instance[property] do
|
||||||
instance.Changed:wait()
|
instance.Changed:wait()
|
||||||
|
|
@ -23,16 +23,16 @@ local function waitForProperty(instance, property)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- A Few Script Globals
|
-- A Few Script Globals
|
||||||
local mercuryGui = script.Parent :: ScreenGui & { ControlFrame: Frame }
|
local MercuryGui = script.Parent :: ScreenGui & { ControlFrame: Frame }
|
||||||
local gui = mercuryGui:FindFirstChild "ControlFrame" and mercuryGui.ControlFrame
|
local gui = MercuryGui:FindFirstChild "ControlFrame" and MercuryGui.ControlFrame
|
||||||
or mercuryGui
|
or MercuryGui
|
||||||
|
|
||||||
local RbxGui
|
local RbxGui
|
||||||
local helpButton, updateCameraDropDownSelection, updateVideoCaptureDropDownSelection
|
local helpButton, updateCameraDropDownSelection, updateVideoCaptureDropDownSelection
|
||||||
local tweenTime = 0.2
|
local tweenTime = 0.2
|
||||||
|
|
||||||
local mouseLockLookScreenUrl = "http://banland.xyz/asset?id=54071825"
|
local mouseLockLookScreenUrl = path "asset?id=54071825"
|
||||||
local classicLookScreenUrl = "http://banland.xyz/asset?id=45915798"
|
local classicLookScreenUrl = path "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
|
||||||
|
|
@ -51,7 +51,7 @@ local inStudioMode = UserSettings().GameSettings:InStudioMode()
|
||||||
|
|
||||||
local macClient = false
|
local macClient = false
|
||||||
local ok, isMac = pcall(function()
|
local ok, isMac = pcall(function()
|
||||||
return not game.GuiService.IsWindows
|
return not GuiService.IsWindows
|
||||||
end)
|
end)
|
||||||
macClient = ok and isMac
|
macClient = ok and isMac
|
||||||
|
|
||||||
|
|
@ -83,9 +83,9 @@ local function resumeGameFunction(shield)
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
for i = 1, #centerDialogs do
|
for i = 1, #centerDialogs do
|
||||||
centerDialogs[i].Visible = false
|
centerDialogs[i].Visible = false
|
||||||
game.GuiService:RemoveCenterDialog(centerDialogs[i])
|
GuiService:RemoveCenterDialog(centerDialogs[i])
|
||||||
end
|
end
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
GuiService:RemoveCenterDialog(shield)
|
||||||
settingsButton.Active = true
|
settingsButton.Active = true
|
||||||
currentMenuSelection = nil
|
currentMenuSelection = nil
|
||||||
lastMenuSelection = {}
|
lastMenuSelection = {}
|
||||||
|
|
@ -182,7 +182,7 @@ local function goToMenu(container, menuName, moveDirection, size, position)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function resetLocalCharacter()
|
local function resetLocalCharacter()
|
||||||
local player = game.Players.LocalPlayer
|
local player = Players.LocalPlayer
|
||||||
if player and player.Character then
|
if player and player.Character then
|
||||||
local humanoid = (player.Character:FindFirstChild "Humanoid") :: Humanoid
|
local humanoid = (player.Character:FindFirstChild "Humanoid") :: Humanoid
|
||||||
if humanoid then
|
if humanoid then
|
||||||
|
|
@ -298,11 +298,11 @@ local function backToGame(buttonClicked, shield, settingsButton2)
|
||||||
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
|
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
for i = 1, #centerDialogs do
|
for i = 1, #centerDialogs do
|
||||||
game.GuiService:RemoveCenterDialog(centerDialogs[i])
|
GuiService:RemoveCenterDialog(centerDialogs[i])
|
||||||
centerDialogs[i].Visible = false
|
centerDialogs[i].Visible = false
|
||||||
end
|
end
|
||||||
centerDialogs = {}
|
centerDialogs = {}
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
GuiService:RemoveCenterDialog(shield)
|
||||||
settingsButton2.Active = true
|
settingsButton2.Active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -417,19 +417,19 @@ local function createHelpDialog(baseZIndex)
|
||||||
{
|
{
|
||||||
Text = "Move",
|
Text = "Move",
|
||||||
Function = function()
|
Function = function()
|
||||||
image.Image = "http://banland.xyz/asset?id=45915811"
|
image.Image = path "asset?id=45915811"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Text = "Gear",
|
Text = "Gear",
|
||||||
Function = function()
|
Function = function()
|
||||||
image.Image = "http://banland.xyz/asset?id=45917596"
|
image.Image = path "asset?id=45917596"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Text = "Zoom",
|
Text = "Zoom",
|
||||||
Function = function()
|
Function = function()
|
||||||
image.Image = "http://banland.xyz/asset?id=45915825"
|
image.Image = path "asset?id=45915825"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}, UDim.new(0, 0), UDim.new(1, 0))
|
}, UDim.new(0, 0), UDim.new(1, 0))
|
||||||
|
|
@ -481,7 +481,7 @@ local function createHelpDialog(baseZIndex)
|
||||||
Parent = helpDialog,
|
Parent = helpDialog,
|
||||||
}).MouseButton1Click:connect(function()
|
}).MouseButton1Click:connect(function()
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
GuiService:RemoveCenterDialog(shield)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
robloxLock(shield)
|
robloxLock(shield)
|
||||||
|
|
@ -695,7 +695,7 @@ local function createGameMainMenu(baseZIndex, shield)
|
||||||
|
|
||||||
helpButton.MouseButton1Click:connect(function()
|
helpButton.MouseButton1Click:connect(function()
|
||||||
table.insert(centerDialogs, helpDialog)
|
table.insert(centerDialogs, helpDialog)
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
helpDialog,
|
helpDialog,
|
||||||
Enum.CenterDialogType.ModalDialog,
|
Enum.CenterDialogType.ModalDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
|
|
@ -843,9 +843,9 @@ local function createGameMainMenu(baseZIndex, shield)
|
||||||
gameSettingsButton.ZIndex = baseZIndex + 4
|
gameSettingsButton.ZIndex = baseZIndex + 4
|
||||||
gameSettingsButton.Parent = gameMainMenuFrame
|
gameSettingsButton.Parent = gameMainMenuFrame
|
||||||
gameSettingsButton.MouseButton1Click:connect(function()
|
gameSettingsButton.MouseButton1Click:connect(function()
|
||||||
if game:FindFirstChild "Players" and game.Players.LocalPlayer then
|
if game:FindFirstChild "Players" and Players.LocalPlayer then
|
||||||
local loadingGui =
|
local loadingGui =
|
||||||
game.Players.LocalPlayer:FindFirstChild "PlayerLoadingGui"
|
Players.LocalPlayer:FindFirstChild "PlayerLoadingGui"
|
||||||
if loadingGui then
|
if loadingGui then
|
||||||
loadingGui.Visible = true
|
loadingGui.Visible = true
|
||||||
end
|
end
|
||||||
|
|
@ -872,7 +872,7 @@ end
|
||||||
|
|
||||||
local mouseLockLabel, syncVideoCaptureSetting
|
local mouseLockLabel, syncVideoCaptureSetting
|
||||||
|
|
||||||
local function createGameSettingsMenu(baseZIndex, _)
|
local function createGameSettingsMenu(baseZIndex: number)
|
||||||
local function fullscreenShortcut()
|
local function fullscreenShortcut()
|
||||||
return New "TextLabel" {
|
return New "TextLabel" {
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
|
|
@ -1022,7 +1022,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
Parent = gameSettingsMenuFrame,
|
Parent = gameSettingsMenuFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
local graphicsSlider, graphicsLevel = RbxGui.CreateSlider(
|
local graphicsSlider, graphicsLevel: NumberValue = RbxGui.CreateSlider(
|
||||||
GraphicsQualityLevels,
|
GraphicsQualityLevels,
|
||||||
150,
|
150,
|
||||||
UDim2.new(0, 230, 0, 280)
|
UDim2.new(0, 230, 0, 280)
|
||||||
|
|
@ -1098,7 +1098,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic
|
settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setGraphicsQualityLevel(newLevel)
|
local function setGraphicsQualityLevel(newLevel: number)
|
||||||
local percentage = newLevel / GraphicsQualityLevels
|
local percentage = newLevel / GraphicsQualityLevels
|
||||||
local newSetting = math.floor(
|
local newSetting = math.floor(
|
||||||
(settings().Rendering:GetMaxQualityLevel() - 1) * percentage
|
(settings().Rendering:GetMaxQualityLevel() - 1) * percentage
|
||||||
|
|
@ -1115,19 +1115,16 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
settings().Rendering.QualityLevel = newSetting
|
settings().Rendering.QualityLevel = newSetting
|
||||||
end
|
end
|
||||||
|
|
||||||
local function goToManualGraphics(explicitLevel)
|
local function goToManualGraphics(explicitLevel: number?)
|
||||||
setAutoGraphicsGui(false)
|
setAutoGraphicsGui(false)
|
||||||
|
|
||||||
if explicitLevel then
|
graphicsLevel.Value = explicitLevel
|
||||||
graphicsLevel.Value = explicitLevel
|
or math.floor(
|
||||||
else
|
|
||||||
graphicsLevel.Value = math.floor(
|
|
||||||
(
|
(
|
||||||
settings().Rendering.AutoFRMLevel
|
settings().Rendering.AutoFRMLevel
|
||||||
/ (settings().Rendering:GetMaxQualityLevel() - 1)
|
/ (settings().Rendering:GetMaxQualityLevel() - 1)
|
||||||
) * GraphicsQualityLevels
|
) * GraphicsQualityLevels
|
||||||
)
|
)
|
||||||
end
|
|
||||||
|
|
||||||
if explicitLevel == graphicsLevel.Value then -- make sure we are actually in right graphics mode
|
if explicitLevel == graphicsLevel.Value then -- make sure we are actually in right graphics mode
|
||||||
setGraphicsQualityLevel(graphicsLevel.Value)
|
setGraphicsQualityLevel(graphicsLevel.Value)
|
||||||
|
|
@ -1279,7 +1276,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
end
|
end
|
||||||
|
|
||||||
autoGraphicsButton.MouseButton1Click:connect(function()
|
autoGraphicsButton.MouseButton1Click:connect(function()
|
||||||
if inStudioMode and not game.Players.LocalPlayer then
|
if inStudioMode and not Players.LocalPlayer then
|
||||||
return
|
return
|
||||||
elseif not isAutoGraphics then
|
elseif not isAutoGraphics then
|
||||||
goToAutoGraphics()
|
goToAutoGraphics()
|
||||||
|
|
@ -1324,13 +1321,13 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
game.Players.PlayerAdded:connect(function(player)
|
Players.PlayerAdded:connect(function(player)
|
||||||
if player == game.Players.LocalPlayer and inStudioMode then
|
if player == Players.LocalPlayer and inStudioMode then
|
||||||
enableGraphicsWidget()
|
enableGraphicsWidget()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
game.Players.PlayerRemoving:connect(function(player)
|
Players.PlayerRemoving:connect(function(player)
|
||||||
if player == game.Players.LocalPlayer and inStudioMode then
|
if player == Players.LocalPlayer and inStudioMode then
|
||||||
disableGraphicsWidget()
|
disableGraphicsWidget()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -1354,7 +1351,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
local wasManualGraphics = (
|
local wasManualGraphics = (
|
||||||
settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic
|
settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic
|
||||||
)
|
)
|
||||||
if inStudioMode and not game.Players.LocalPlayer then
|
if inStudioMode and not Players.LocalPlayer then
|
||||||
studioCheckbox.Text = "X"
|
studioCheckbox.Text = "X"
|
||||||
disableGraphicsWidget()
|
disableGraphicsWidget()
|
||||||
elseif inStudioMode then
|
elseif inStudioMode then
|
||||||
|
|
@ -1510,12 +1507,12 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
updateVideoCaptureDropDownSelection(videoNames[1])
|
updateVideoCaptureDropDownSelection(videoNames[1])
|
||||||
elseif
|
elseif
|
||||||
UserSettings().GameSettings.VideoUploadPromptBehavior
|
UserSettings().GameSettings.VideoUploadPromptBehavior
|
||||||
== Enum.UploadSetting["Ask me first"]
|
== Enum.UploadSetting.Ask
|
||||||
then
|
then
|
||||||
updateVideoCaptureDropDownSelection(videoNames[2])
|
updateVideoCaptureDropDownSelection(videoNames[2])
|
||||||
else
|
else
|
||||||
UserSettings().GameSettings.VideoUploadPromptBehavior =
|
UserSettings().GameSettings.VideoUploadPromptBehavior =
|
||||||
Enum.UploadSetting["Ask me first"]
|
Enum.UploadSetting.Ask
|
||||||
updateVideoCaptureDropDownSelection(videoNames[2])
|
updateVideoCaptureDropDownSelection(videoNames[2])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1535,7 +1532,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
||||||
Parent = gameSettingsMenuFrame,
|
Parent = gameSettingsMenuFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseLockLabel = CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true)
|
mouseLockLabel = MercuryGui:FindFirstChild("MouseLockLabel", true)
|
||||||
|
|
||||||
local enumItems = Enum.ControlMode:GetEnumItems()
|
local enumItems = Enum.ControlMode:GetEnumItems()
|
||||||
local enumNames = {}
|
local enumNames = {}
|
||||||
|
|
@ -1662,7 +1659,7 @@ if UserSettings then
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
CoreGui.RobloxGui.Changed:connect(
|
MercuryGui.Changed:connect(
|
||||||
function(prop) -- We have stopped recording when we resize
|
function(prop) -- We have stopped recording when we resize
|
||||||
if prop == "AbsoluteSize" and recordingVideo then
|
if prop == "AbsoluteSize" and recordingVideo then
|
||||||
recordVideoClick(
|
recordVideoClick(
|
||||||
|
|
@ -1674,24 +1671,24 @@ if UserSettings then
|
||||||
)
|
)
|
||||||
|
|
||||||
local function localPlayerChange()
|
local function localPlayerChange()
|
||||||
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
|
gameMainMenu.ResetButton.Visible = Players.LocalPlayer
|
||||||
if game.Players.LocalPlayer then
|
if Players.LocalPlayer then
|
||||||
settings().Rendering.EnableFRM = true
|
settings().Rendering.EnableFRM = true
|
||||||
elseif inStudioMode then
|
elseif inStudioMode then
|
||||||
settings().Rendering.EnableFRM = false
|
settings().Rendering.EnableFRM = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
|
gameMainMenu.ResetButton.Visible = Players.LocalPlayer
|
||||||
if game.Players.LocalPlayer ~= nil then
|
if Players.LocalPlayer ~= nil then
|
||||||
game.Players.LocalPlayer.Changed:connect(function()
|
Players.LocalPlayer.Changed:connect(function()
|
||||||
localPlayerChange()
|
localPlayerChange()
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
delay(0, function()
|
delay(0, function()
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
|
gameMainMenu.ResetButton.Visible = Players.LocalPlayer
|
||||||
game.Players.LocalPlayer.Changed:connect(function()
|
Players.LocalPlayer.Changed:connect(function()
|
||||||
localPlayerChange()
|
localPlayerChange()
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
@ -1806,7 +1803,7 @@ if UserSettings then
|
||||||
hotkeysConn = GuiService.KeyPressed:connect(leaveResetHotkeys)
|
hotkeysConn = GuiService.KeyPressed:connect(leaveResetHotkeys)
|
||||||
end)
|
end)
|
||||||
if currentMenuSelection == nil then
|
if currentMenuSelection == nil then
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
shield,
|
shield,
|
||||||
Enum.CenterDialogType.ModalDialog,
|
Enum.CenterDialogType.ModalDialog,
|
||||||
showFunction,
|
showFunction,
|
||||||
|
|
@ -1815,7 +1812,7 @@ if UserSettings then
|
||||||
elseif #lastMenuSelection > 0 then
|
elseif #lastMenuSelection > 0 then
|
||||||
if #centerDialogs > 0 then
|
if #centerDialogs > 0 then
|
||||||
for i = 1, #centerDialogs do
|
for i = 1, #centerDialogs do
|
||||||
game.GuiService:RemoveCenterDialog(centerDialogs[i])
|
GuiService:RemoveCenterDialog(centerDialogs[i])
|
||||||
centerDialogs[i].Visible = false
|
centerDialogs[i].Visible = false
|
||||||
end
|
end
|
||||||
centerDialogs = {}
|
centerDialogs = {}
|
||||||
|
|
@ -1872,7 +1869,7 @@ if UserSettings then
|
||||||
robloxLock(shield)
|
robloxLock(shield)
|
||||||
|
|
||||||
settingsButton.MouseButton1Click:connect(function()
|
settingsButton.MouseButton1Click:connect(function()
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
shield,
|
shield,
|
||||||
Enum.CenterDialogType.ModalDialog,
|
Enum.CenterDialogType.ModalDialog,
|
||||||
--showFunction
|
--showFunction
|
||||||
|
|
@ -2091,7 +2088,7 @@ local function createSaveDialogs()
|
||||||
-8
|
-8
|
||||||
),
|
),
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=45880710",
|
Image = path "asset?id=45880710",
|
||||||
Parent = spinnerFrame,
|
Parent = spinnerFrame,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -2110,13 +2107,11 @@ local function createSaveDialogs()
|
||||||
local pos = 0
|
local pos = 0
|
||||||
|
|
||||||
while pos < 8 do
|
while pos < 8 do
|
||||||
if pos == spinPos or pos == ((spinPos + 1) % 8) then
|
spinnerIcons[pos + 1].Image = (
|
||||||
spinnerIcons[pos + 1].Image =
|
pos == spinPos or pos == ((spinPos + 1) % 8)
|
||||||
"http://banland.xyz/asset?id=45880668"
|
)
|
||||||
else
|
and path "asset?id=45880668"
|
||||||
spinnerIcons[pos + 1].Image =
|
or path "asset?id=45880710"
|
||||||
"http://banland.xyz/asset?id=45880710"
|
|
||||||
end
|
|
||||||
|
|
||||||
pos += 1
|
pos += 1
|
||||||
end
|
end
|
||||||
|
|
@ -2171,7 +2166,7 @@ local function createSaveDialogs()
|
||||||
errorDialogMessageBox.Visible = false
|
errorDialogMessageBox.Visible = false
|
||||||
spinnerDialog.Visible = false
|
spinnerDialog.Visible = false
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
GuiService:RemoveCenterDialog(shield)
|
||||||
end
|
end
|
||||||
|
|
||||||
robloxLock(shield)
|
robloxLock(shield)
|
||||||
|
|
@ -2184,8 +2179,8 @@ local function createReportAbuseDialog()
|
||||||
waitForChild(game, "NetworkClient")
|
waitForChild(game, "NetworkClient")
|
||||||
|
|
||||||
waitForChild(game, "Players")
|
waitForChild(game, "Players")
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
local localPlayer = game.Players.LocalPlayer
|
local localPlayer = Players.LocalPlayer
|
||||||
|
|
||||||
local reportAbuseButton
|
local reportAbuseButton
|
||||||
waitForChild(gui, "UserSettingsShield")
|
waitForChild(gui, "UserSettingsShield")
|
||||||
|
|
@ -2448,7 +2443,7 @@ local function createReportAbuseDialog()
|
||||||
if submitReportButton.Active then
|
if submitReportButton.Active then
|
||||||
if abuse and abusingPlayer then
|
if abuse and abusingPlayer then
|
||||||
frame.Visible = false
|
frame.Visible = false
|
||||||
game.Players:ReportAbuse(
|
Players:ReportAbuse(
|
||||||
abusingPlayer,
|
abusingPlayer,
|
||||||
abuse,
|
abuse,
|
||||||
shortDescriptionBox.Text
|
shortDescriptionBox.Text
|
||||||
|
|
@ -2499,7 +2494,7 @@ local function createReportAbuseDialog()
|
||||||
normalMessageBox.Visible = false
|
normalMessageBox.Visible = false
|
||||||
shield.Visible = false
|
shield.Visible = false
|
||||||
reportAbuseButton.Active = true
|
reportAbuseButton.Active = true
|
||||||
game.GuiService:RemoveCenterDialog(shield)
|
GuiService:RemoveCenterDialog(shield)
|
||||||
end
|
end
|
||||||
|
|
||||||
cancelButton.MouseButton1Click:connect(closeAndResetDialog)
|
cancelButton.MouseButton1Click:connect(closeAndResetDialog)
|
||||||
|
|
@ -2507,7 +2502,7 @@ local function createReportAbuseDialog()
|
||||||
reportAbuseButton.MouseButton1Click:connect(function()
|
reportAbuseButton.MouseButton1Click:connect(function()
|
||||||
createPlayersDropDown().Parent = reportAbuseFrame
|
createPlayersDropDown().Parent = reportAbuseFrame
|
||||||
table.insert(centerDialogs, shield)
|
table.insert(centerDialogs, shield)
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
shield,
|
shield,
|
||||||
Enum.CenterDialogType.ModalDialog,
|
Enum.CenterDialogType.ModalDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
|
|
@ -2539,7 +2534,7 @@ if isSaveDialogSupported then
|
||||||
|
|
||||||
function game.RequestShutdown()
|
function game.RequestShutdown()
|
||||||
table.insert(centerDialogs, saveDialogs)
|
table.insert(centerDialogs, saveDialogs)
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
saveDialogs,
|
saveDialogs,
|
||||||
Enum.CenterDialogType.QuitDialog,
|
Enum.CenterDialogType.QuitDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,21 @@
|
||||||
-- CoreGui.RobloxGui.CoreScripts/PlayerListScript
|
-- CoreGui.RobloxGui.CoreScripts/PlayerListScript
|
||||||
print "[Mercury]: Loaded corescript 48488235"
|
print "[Mercury]: Loaded corescript 48488235"
|
||||||
|
|
||||||
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local PersonalServerService =
|
||||||
|
game:GetService "PersonalServerService" :: PersonalServerService
|
||||||
|
local Players = game:GetService "Players"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
|
local StarterGui = game:GetService "StarterGui"
|
||||||
|
local Teams = game:GetService "Teams"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
local log = require "../Modules/Logger"
|
local log = require "../Modules/Logger"
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
-- Super Util
|
-- Super Util
|
||||||
|
|
@ -16,9 +25,7 @@ local log = require "../Modules/Logger"
|
||||||
local ADMINS = {
|
local ADMINS = {
|
||||||
taskmanager = 1,
|
taskmanager = 1,
|
||||||
heliodex = 1,
|
heliodex = 1,
|
||||||
multako = "http://banland.xyz/asset?id=6923328292",
|
|
||||||
mercury = 1,
|
mercury = 1,
|
||||||
pizzaboxer = "http://banland.xyz/asset?id=6917566633",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local Images = {
|
local Images = {
|
||||||
|
|
@ -75,7 +82,7 @@ end
|
||||||
local function getMembershipTypeIcon(membershipType, playerName)
|
local function getMembershipTypeIcon(membershipType, playerName)
|
||||||
if ADMINS[string.lower(playerName)] ~= nil then
|
if ADMINS[string.lower(playerName)] ~= nil then
|
||||||
if ADMINS[string.lower(playerName)] == 1 then
|
if ADMINS[string.lower(playerName)] == 1 then
|
||||||
return "http://banland.xyz/asset?id=6923330951"
|
return path "asset?id=6923330951"
|
||||||
end
|
end
|
||||||
return ADMINS[string.lower(playerName)]
|
return ADMINS[string.lower(playerName)]
|
||||||
elseif membershipType == Enum.MembershipType.None then
|
elseif membershipType == Enum.MembershipType.None then
|
||||||
|
|
@ -86,9 +93,8 @@ local function getMembershipTypeIcon(membershipType, playerName)
|
||||||
return "rbxasset://textures/ui/TinyTbcIcon.png"
|
return "rbxasset://textures/ui/TinyTbcIcon.png"
|
||||||
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
|
|
||||||
error("Unknown membershipType " .. membershipType)
|
|
||||||
end
|
end
|
||||||
|
error("Unknown membershipType " .. membershipType)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getFriendStatusIcon(friendStatus)
|
local function getFriendStatusIcon(friendStatus)
|
||||||
|
|
@ -98,25 +104,15 @@ local function getFriendStatusIcon(friendStatus)
|
||||||
then
|
then
|
||||||
return ""
|
return ""
|
||||||
elseif friendStatus == Enum.FriendStatus.Friend then
|
elseif friendStatus == Enum.FriendStatus.Friend then
|
||||||
return "http://banland.xyz/asset?id=99749771"
|
return path "asset?id=99749771"
|
||||||
elseif friendStatus == Enum.FriendStatus.FriendRequestSent then
|
elseif friendStatus == Enum.FriendStatus.FriendRequestSent then
|
||||||
return "http://banland.xyz/asset?id=99776888"
|
return path "asset?id=99776888"
|
||||||
elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then
|
elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then
|
||||||
return "http://banland.xyz/asset?id=99776838"
|
return path "asset?id=99776838"
|
||||||
else
|
|
||||||
error("Unknown FriendStatus " .. friendStatus)
|
|
||||||
end
|
end
|
||||||
|
error("Unknown FriendStatus " .. friendStatus)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------
|
|
||||||
-- Workspace Objects
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
-- might want to move all this to an init function, wait for localplayer elsewhere
|
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
|
||||||
local PersonalServerService = game:GetService "PersonalServerService"
|
|
||||||
local Players = game:GetService "Players"
|
|
||||||
|
|
||||||
-- make sure this doesn't run on the server(it will if you dont do this)
|
-- make sure this doesn't run on the server(it will if you dont do this)
|
||||||
while not Players.LocalPlayer do
|
while not Players.LocalPlayer do
|
||||||
Players.Changed:wait()
|
Players.Changed:wait()
|
||||||
|
|
@ -156,7 +152,7 @@ local HeaderFrame = New "Frame" {
|
||||||
Position = UDim2.new(0, 0, 0, 0),
|
Position = UDim2.new(0, 0, 0, 0),
|
||||||
Size = UDim2.new(1, 0, 0.07, 0),
|
Size = UDim2.new(1, 0, 0.07, 0),
|
||||||
Parent = MainFrame,
|
Parent = MainFrame,
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=94692054",
|
MakeBackgroundGuiObj(path "asset?id=94692054"),
|
||||||
}
|
}
|
||||||
local HeaderFrameHeight = HeaderFrame.Size.Y.Scale
|
local HeaderFrameHeight = HeaderFrame.Size.Y.Scale
|
||||||
local MaximizeButton = New "ImageButton" {
|
local MaximizeButton = New "ImageButton" {
|
||||||
|
|
@ -213,7 +209,7 @@ local BottomFrame = New "Frame" {
|
||||||
Position = UDim2.new(0, 0, 0.07, 0),
|
Position = UDim2.new(0, 0, 0.07, 0),
|
||||||
Size = UDim2.new(1, 0, 0.03, 0),
|
Size = UDim2.new(1, 0, 0.03, 0),
|
||||||
Parent = BottomShiftFrame,
|
Parent = BottomShiftFrame,
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=94754966",
|
MakeBackgroundGuiObj(path "asset?id=94754966"),
|
||||||
}
|
}
|
||||||
local ExtendButton = New "ImageButton" {
|
local ExtendButton = New "ImageButton" {
|
||||||
Name = "bigbutton",
|
Name = "bigbutton",
|
||||||
|
|
@ -228,7 +224,7 @@ local ExtendTab = New "ImageButton" {
|
||||||
Name = "extendTab",
|
Name = "extendTab",
|
||||||
Active = true,
|
Active = true,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=94692731",
|
Image = path "asset?id=94692731",
|
||||||
Position = UDim2.new(0.608, 0, 0.3, 0),
|
Position = UDim2.new(0.608, 0, 0.3, 0),
|
||||||
Size = UDim2.new(0.3, 0, 0.7, 0),
|
Size = UDim2.new(0.3, 0, 0.7, 0),
|
||||||
Parent = BottomFrame,
|
Parent = BottomFrame,
|
||||||
|
|
@ -386,7 +382,7 @@ local MiddleBGTemplate = New "Frame" {
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Position = UDim2.new(100, 0, 0.07, 0),
|
Position = UDim2.new(100, 0, 0.07, 0),
|
||||||
Size = UDim2.new(0.5, 0, 0.025, 0), --UDim2.new(1, 0, .03, 0),
|
Size = UDim2.new(0.5, 0, 0.025, 0), --UDim2.new(1, 0, .03, 0),
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=94692025",
|
MakeBackgroundGuiObj(path "asset?id=94692025"),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- REPORT ABUSE OBJECTS
|
-- REPORT ABUSE OBJECTS
|
||||||
|
|
@ -417,7 +413,7 @@ local AbuseSettingsFrame = New "Frame" {
|
||||||
Size = UDim2.new(1, 0, 1, 0),
|
Size = UDim2.new(1, 0, 1, 0),
|
||||||
Active = true,
|
Active = true,
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=96488767", -- 96480351",
|
MakeBackgroundGuiObj(path "asset?id=96488767"), -- 96480351",
|
||||||
New "TextLabel" {
|
New "TextLabel" {
|
||||||
Name = "Title",
|
Name = "Title",
|
||||||
Text = "Report Abuse",
|
Text = "Report Abuse",
|
||||||
|
|
@ -496,7 +492,7 @@ local SubmitReportButton = New "ImageButton" {
|
||||||
Position = UDim2.new(0.5, -200, 1, -80),
|
Position = UDim2.new(0.5, -200, 1, -80),
|
||||||
Size = UDim2.new(0, 150, 0, 50),
|
Size = UDim2.new(0, 150, 0, 50),
|
||||||
AutoButtonColor = false,
|
AutoButtonColor = false,
|
||||||
Image = "http://banland.xyz/asset?id=96502438", -- 96501119',
|
Image = path "asset?id=96502438", -- 96501119',
|
||||||
Parent = AbuseSettingsFrame,
|
Parent = AbuseSettingsFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -506,7 +502,7 @@ local CancelReportButton = New "ImageButton" {
|
||||||
Position = UDim2.new(0.5, 50, 1, -80),
|
Position = UDim2.new(0.5, 50, 1, -80),
|
||||||
Size = UDim2.new(0, 150, 0, 50),
|
Size = UDim2.new(0, 150, 0, 50),
|
||||||
AutoButtonColor = true,
|
AutoButtonColor = true,
|
||||||
Image = "http://banland.xyz/asset?id=96500683",
|
Image = path "asset?id=96500683",
|
||||||
Parent = AbuseSettingsFrame,
|
Parent = AbuseSettingsFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -542,7 +538,7 @@ local CalmingAbuseBox = New "Frame" {
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Position = UDim2.new(0.25, 0, 0.300000012, 0),
|
Position = UDim2.new(0.25, 0, 0.300000012, 0),
|
||||||
Size = UDim2.new(0.5, 0, 0.370000005, 0),
|
Size = UDim2.new(0.5, 0, 0.370000005, 0),
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=96506233",
|
MakeBackgroundGuiObj(path "asset?id=96506233"),
|
||||||
New "TextLabel" {
|
New "TextLabel" {
|
||||||
Name = "Header",
|
Name = "Header",
|
||||||
Position = UDim2.new(0, 10, 0.05, 0),
|
Position = UDim2.new(0, 10, 0.05, 0),
|
||||||
|
|
@ -575,7 +571,7 @@ local CalmingAbuseBox = New "Frame" {
|
||||||
Position = UDim2.new(0.5, -75, 1, -80),
|
Position = UDim2.new(0.5, -75, 1, -80),
|
||||||
Size = UDim2.new(0, 150, 0, 50),
|
Size = UDim2.new(0, 150, 0, 50),
|
||||||
AutoButtonColor = true,
|
AutoButtonColor = true,
|
||||||
Image = "http://banland.xyz/asset?id=96507959",
|
Image = path "asset?id=96507959",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
local NormalAbuseBox = New "Frame" {
|
local NormalAbuseBox = New "Frame" {
|
||||||
|
|
@ -583,7 +579,7 @@ local NormalAbuseBox = New "Frame" {
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Position = UDim2.new(0.25, 0, 0.300000012, 0),
|
Position = UDim2.new(0.25, 0, 0.300000012, 0),
|
||||||
Size = UDim2.new(0.5, 0, 0.370000005, 0),
|
Size = UDim2.new(0.5, 0, 0.370000005, 0),
|
||||||
MakeBackgroundGuiObj "http://banland.xyz/asset?id=96506233",
|
MakeBackgroundGuiObj(path "asset?id=96506233"),
|
||||||
New "TextLabel" {
|
New "TextLabel" {
|
||||||
Name = "Header",
|
Name = "Header",
|
||||||
Position = UDim2.new(0, 10, 0.05, 0),
|
Position = UDim2.new(0, 10, 0.05, 0),
|
||||||
|
|
@ -616,7 +612,7 @@ local NormalAbuseBox = New "Frame" {
|
||||||
Position = UDim2.new(0.5, -75, 1, -80),
|
Position = UDim2.new(0.5, -75, 1, -80),
|
||||||
Size = UDim2.new(0, 150, 0, 50),
|
Size = UDim2.new(0, 150, 0, 50),
|
||||||
AutoButtonColor = true,
|
AutoButtonColor = true,
|
||||||
Image = "http://banland.xyz/asset?id=96507959",
|
Image = path "asset?id=96507959",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -653,7 +649,7 @@ local RbxGui = assert(LoadLibrary "RbxGui")
|
||||||
local DefaultEntriesOnScreen = 8
|
local DefaultEntriesOnScreen = 8
|
||||||
|
|
||||||
for _, i in pairs(Images) do
|
for _, i in pairs(Images) do
|
||||||
ContentProvider:Preload("http://banland.xyz/asset?id=" .. i)
|
ContentProvider:Preload(path "asset?id=" .. i)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ordered array of 'score data', each entry has:
|
-- ordered array of 'score data', each entry has:
|
||||||
|
|
@ -893,7 +889,7 @@ end
|
||||||
player player to change rank of
|
player player to change rank of
|
||||||
nrank new integer rank to give player
|
nrank new integer rank to give player
|
||||||
--]]
|
--]]
|
||||||
local function SetPrivilegeRank(player, nrank: number)
|
local function SetPrivilegeRank(player: Player, nrank: number)
|
||||||
while player.PersonalServerRank < nrank do
|
while player.PersonalServerRank < nrank do
|
||||||
PersonalServerService:Promote(player)
|
PersonalServerService:Promote(player)
|
||||||
end
|
end
|
||||||
|
|
@ -914,25 +910,20 @@ local function HighlightMyRank(
|
||||||
MemberButton,
|
MemberButton,
|
||||||
AdminButton
|
AdminButton
|
||||||
)
|
)
|
||||||
BanPlayerButton.Image = "http://banland.xyz/asset?id="
|
BanPlayerButton.Image = path "asset?id=" .. Images.LightPopupMid
|
||||||
.. Images.LightPopupMid
|
VisitorButton.Image = path "asset?id=" .. Images.DarkPopupMid
|
||||||
VisitorButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupMid
|
MemberButton.Image = path "asset?id=" .. Images.LightPopupMid
|
||||||
MemberButton.Image = "http://banland.xyz/asset?id=" .. Images.LightPopupMid
|
AdminButton.Image = path "asset?id=" .. Images.DarkPopupBottom
|
||||||
AdminButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupBottom
|
|
||||||
|
|
||||||
local rank = player.PersonalServerRank
|
local rank = player.PersonalServerRank
|
||||||
if rank <= PrivilegeLevel.Banned then
|
if rank <= PrivilegeLevel.Banned then
|
||||||
BanPlayerButton.Image =
|
BanPlayerButton.Image = path "asset?id=" .. Images.LightBluePopupMid
|
||||||
`http://banland.xyz/asset?id={Images.LightBluePopupMid}`
|
|
||||||
elseif rank <= PrivilegeLevel.Visitor then
|
elseif rank <= PrivilegeLevel.Visitor then
|
||||||
VisitorButton.Image =
|
VisitorButton.Image = path "asset?id=" .. Images.DarkBluePopupMid
|
||||||
`http://banland.xyz/asset?id={Images.DarkBluePopupMid}`
|
|
||||||
elseif rank <= PrivilegeLevel.Member then
|
elseif rank <= PrivilegeLevel.Member then
|
||||||
MemberButton.Image =
|
MemberButton.Image = path "asset?id=" .. Images.LightBluePopupMid
|
||||||
`http://banland.xyz/asset?id={Images.LightBluePopupMid}`
|
|
||||||
elseif rank <= PrivilegeLevel.Admin then
|
elseif rank <= PrivilegeLevel.Admin then
|
||||||
AdminButton.Image =
|
AdminButton.Image = path "asset?id=" .. Images.DarkBluePopupBottom
|
||||||
`http://banland.xyz/asset?id={Images.DarkBluePopupBottom}`
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -971,7 +962,7 @@ end
|
||||||
local function CloseAbuseDialog()
|
local function CloseAbuseDialog()
|
||||||
AbuseName = nil
|
AbuseName = nil
|
||||||
SubmitReportButton.Active = false
|
SubmitReportButton.Active = false
|
||||||
SubmitReportButton.Image = "http://banland.xyz/asset?id=96502438" -- 96501119",
|
SubmitReportButton.Image = path "asset?id=96502438" -- 96501119",
|
||||||
AbuseDescriptionBox:Destroy()
|
AbuseDescriptionBox:Destroy()
|
||||||
CalmingAbuseBox.Parent = nil
|
CalmingAbuseBox.Parent = nil
|
||||||
NormalAbuseBox.Parent = nil
|
NormalAbuseBox.Parent = nil
|
||||||
|
|
@ -986,7 +977,7 @@ local function OnSubmitAbuse()
|
||||||
if SubmitReportButton.Active then
|
if SubmitReportButton.Active then
|
||||||
if AbuseName and SelectedPlayer then
|
if AbuseName and SelectedPlayer then
|
||||||
AbuseSettingsFrame.Visible = false
|
AbuseSettingsFrame.Visible = false
|
||||||
game.Players:ReportAbuse(
|
Players:ReportAbuse(
|
||||||
SelectedPlayer,
|
SelectedPlayer,
|
||||||
AbuseName,
|
AbuseName,
|
||||||
AbuseDescriptionBox.Text
|
AbuseDescriptionBox.Text
|
||||||
|
|
@ -1053,7 +1044,7 @@ local function InitReportAbuse()
|
||||||
AbuseName = abuseText
|
AbuseName = abuseText
|
||||||
if AbuseName and SelectedPlayer then
|
if AbuseName and SelectedPlayer then
|
||||||
SubmitReportButton.Active = true
|
SubmitReportButton.Active = true
|
||||||
SubmitReportButton.Image = "http://banland.xyz/asset?id=96501119"
|
SubmitReportButton.Image = path "asset?id=96501119"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -1082,11 +1073,11 @@ end
|
||||||
@Return: enum of friend status
|
@Return: enum of friend status
|
||||||
--]]
|
--]]
|
||||||
local function GetFriendStatus(player: Player)
|
local function GetFriendStatus(player: Player)
|
||||||
if player == game.Players.LocalPlayer then
|
if player == Players.LocalPlayer then
|
||||||
return Enum.FriendStatus.NotFriend
|
return Enum.FriendStatus.NotFriend
|
||||||
end
|
end
|
||||||
local ok, result = pcall(function()
|
local ok, result = pcall(function()
|
||||||
return game.Players.LocalPlayer:GetFriendStatus(player)
|
return Players.LocalPlayer:GetFriendStatus(player)
|
||||||
end)
|
end)
|
||||||
if ok then
|
if ok then
|
||||||
return result
|
return result
|
||||||
|
|
@ -1352,17 +1343,13 @@ local function UpdateMaximize()
|
||||||
BASE_TWEEN * 1.2,
|
BASE_TWEEN * 1.2,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
HeaderFrame.Background.Image = "http://banland.xyz/asset?id="
|
HeaderFrame.Background.Image = path "asset?id=" .. Images.LargeHeader
|
||||||
.. Images.LargeHeader
|
BottomFrame.Background.Image = path "asset?id=" .. Images.LargeBottom
|
||||||
BottomFrame.Background.Image = "http://banland.xyz/asset?id="
|
|
||||||
.. Images.LargeBottom
|
|
||||||
for index, i in ipairs(MiddleFrameBackgrounds) do
|
for index, i in ipairs(MiddleFrameBackgrounds) do
|
||||||
if (index % 2) ~= 1 then
|
if (index % 2) ~= 1 then
|
||||||
i.Background.Image = "http://banland.xyz/asset?id="
|
i.Background.Image = path "asset?id=" .. Images.LargeDark
|
||||||
.. Images.LargeDark
|
|
||||||
else
|
else
|
||||||
i.Background.Image = "http://banland.xyz/asset?id="
|
i.Background.Image = path "asset?id=" .. Images.LargeLight
|
||||||
.. Images.LargeLight
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, i in ipairs(MiddleFrames) do
|
for _, i in ipairs(MiddleFrames) do
|
||||||
|
|
@ -1422,17 +1409,13 @@ local function UpdateMaximize()
|
||||||
BASE_TWEEN * 1.2,
|
BASE_TWEEN * 1.2,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
HeaderFrame.Background.Image = "http://banland.xyz/asset?id="
|
HeaderFrame.Background.Image = path "asset?id=" .. Images.NormalHeader
|
||||||
.. Images.NormalHeader
|
BottomFrame.Background.Image = path "asset?id=" .. Images.NormalBottom
|
||||||
BottomFrame.Background.Image = "http://banland.xyz/asset?id="
|
|
||||||
.. Images.NormalBottom
|
|
||||||
for index, i in ipairs(MiddleFrameBackgrounds) do
|
for index, i in ipairs(MiddleFrameBackgrounds) do
|
||||||
if index % 2 ~= 1 then
|
if index % 2 ~= 1 then
|
||||||
i.Background.Image = "http://banland.xyz/asset?id="
|
i.Background.Image = path "asset?id=" .. Images.midDark
|
||||||
.. Images.midDark
|
|
||||||
else
|
else
|
||||||
i.Background.Image = "http://banland.xyz/asset?id="
|
i.Background.Image = path "asset?id=" .. Images.midLight
|
||||||
.. Images.midLight
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, i in ipairs(MiddleFrames) do
|
for _, i in ipairs(MiddleFrames) do
|
||||||
|
|
@ -1474,6 +1457,12 @@ local function UpdateMaximize()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
type ValueBase = {
|
||||||
|
Value: any,
|
||||||
|
ConstrainedValue: number,
|
||||||
|
IsA: (self: ValueBase, name: string) -> boolean,
|
||||||
|
}
|
||||||
|
|
||||||
local function GetScoreValue(score: ValueBase): number
|
local function GetScoreValue(score: ValueBase): number
|
||||||
if
|
if
|
||||||
score:IsA "DoubleConstrainedValue" or score:IsA "IntConstrainedValue"
|
score:IsA "DoubleConstrainedValue" or score:IsA "IntConstrainedValue"
|
||||||
|
|
@ -1601,17 +1590,21 @@ local function AddTeamScores(team)
|
||||||
UpdateMinimize()
|
UpdateMinimize()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
type SortableTeam = {
|
||||||
|
TeamScore: number,
|
||||||
|
ID: number,
|
||||||
|
MyPlayers: { any },
|
||||||
|
}
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
uses lua's table.sort to sort the teams
|
uses lua's table.sort to sort the teams
|
||||||
--]]
|
--]]
|
||||||
local function TeamSortFunc(a, b)
|
local function TeamSortFunc(a: SortableTeam, b: SortableTeam)
|
||||||
if a.TeamScore == b.TeamScore then
|
if a.TeamScore == b.TeamScore then
|
||||||
return a.ID < b.ID
|
return a.ID < b.ID
|
||||||
end
|
elseif not a.TeamScore then
|
||||||
if not a.TeamScore then
|
|
||||||
return false
|
return false
|
||||||
end
|
elseif not b.TeamScore then
|
||||||
if not b.TeamScore then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return a.TeamScore < b.TeamScore
|
return a.TeamScore < b.TeamScore
|
||||||
|
|
@ -1896,7 +1889,7 @@ function UpdateMinimize()
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
FocusFrame.Size = UDim2.new(1, 0, HeaderFrameHeight, 0)
|
FocusFrame.Size = UDim2.new(1, 0, HeaderFrameHeight, 0)
|
||||||
ExtendTab.Image = "http://banland.xyz/asset?id=94692731"
|
ExtendTab.Image = path "asset?id=94692731"
|
||||||
else
|
else
|
||||||
if not IsMaximized.Value then
|
if not IsMaximized.Value then
|
||||||
MainFrame:TweenSizeAndPosition(
|
MainFrame:TweenSizeAndPosition(
|
||||||
|
|
@ -1921,7 +1914,7 @@ function UpdateMinimize()
|
||||||
)
|
)
|
||||||
BottomFrame.Position = UDim2.new(0, 0, bottomPositon, 0)
|
BottomFrame.Position = UDim2.new(0, 0, bottomPositon, 0)
|
||||||
FocusFrame.Size = UDim2.new(1, 0, bottomPositon + HeaderFrameHeight, 0)
|
FocusFrame.Size = UDim2.new(1, 0, bottomPositon + HeaderFrameHeight, 0)
|
||||||
ExtendTab.Image = "http://banland.xyz/asset?id=94825585"
|
ExtendTab.Image = path "asset?id=94825585"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -2066,7 +2059,7 @@ local function StatAdded(nchild, playerEntry)
|
||||||
end
|
end
|
||||||
|
|
||||||
--returns whether any of the existing players has this stat
|
--returns whether any of the existing players has this stat
|
||||||
local function DoesStatExist(statName, exception)
|
local function DoesStatExist(statName, exception: Player)
|
||||||
for _, playerf in pairs(PlayerFrames) do
|
for _, playerf in pairs(PlayerFrames) do
|
||||||
if
|
if
|
||||||
playerf.Player ~= exception
|
playerf.Player ~= exception
|
||||||
|
|
@ -2216,14 +2209,14 @@ local function MakePopupButton(nparent, ntext, index, last: boolean?)
|
||||||
Parent = nparent,
|
Parent = nparent,
|
||||||
}
|
}
|
||||||
if index == 0 then
|
if index == 0 then
|
||||||
tobj.Image = "http://banland.xyz/asset?id=97108784"
|
tobj.Image = path "asset?id=97108784"
|
||||||
elseif last then
|
elseif last then
|
||||||
tobj.Image = index % 2 == 1
|
tobj.Image = index % 2 == 1
|
||||||
and "http://banland.xyz/asset?id=" .. Images.LightPopupBottom
|
and path "asset?id=" .. Images.LightPopupBottom
|
||||||
or "http://banland.xyz/asset?id=" .. Images.DarkPopupBottom
|
or path "asset?id=" .. Images.DarkPopupBottom
|
||||||
else
|
else
|
||||||
tobj.Image = index % 2 == 1 and "http://banland.xyz/asset?id=97112126"
|
tobj.Image = index % 2 == 1 and path "asset?id=97112126"
|
||||||
or "http://banland.xyz/asset?id=97109338"
|
or path "asset?id=97109338"
|
||||||
end
|
end
|
||||||
return tobj
|
return tobj
|
||||||
end
|
end
|
||||||
|
|
@ -2555,7 +2548,7 @@ local function AddMiddleBGFrame()
|
||||||
UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0)
|
UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0)
|
||||||
|
|
||||||
local function applyImage(id: string)
|
local function applyImage(id: string)
|
||||||
nBGFrame.Background.Image = "http://banland.xyz/asset?id=" .. id
|
nBGFrame.Background.Image = path "asset?id=" .. id
|
||||||
end
|
end
|
||||||
|
|
||||||
if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then
|
if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then
|
||||||
|
|
@ -2800,7 +2793,7 @@ local function SetPlayerToTeam(entry)
|
||||||
end
|
end
|
||||||
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 #Teams:GetTeams() > 0 then
|
||||||
log(`{entry.Player.Name} could not find team`)
|
log(`{entry.Player.Name} could not find team`)
|
||||||
entry.MyTeam = nil
|
entry.MyTeam = nil
|
||||||
if not NeutralTeam then
|
if not NeutralTeam then
|
||||||
|
|
@ -2827,7 +2820,7 @@ local function PlayerChanged(entry, property)
|
||||||
PlayerChangedLock = true
|
PlayerChangedLock = true
|
||||||
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 #(Teams:GetTeams()) > 0 then
|
||||||
log(entry.Player.Name .. " setting to neutral")
|
log(entry.Player.Name .. " setting to neutral")
|
||||||
FindRemovePlayerFromTeam(entry)
|
FindRemovePlayerFromTeam(entry)
|
||||||
entry.MyTeam = nil
|
entry.MyTeam = nil
|
||||||
|
|
@ -2838,7 +2831,7 @@ local function PlayerChanged(entry, property)
|
||||||
log(entry.Player.Name .. " adding to neutral team")
|
log(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 #(Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase
|
||||||
log(entry.Player.Name .. " has been set non-neutral")
|
log(entry.Player.Name .. " has been set non-neutral")
|
||||||
SetPlayerToTeam(entry)
|
SetPlayerToTeam(entry)
|
||||||
end
|
end
|
||||||
|
|
@ -3276,46 +3269,47 @@ end
|
||||||
--[[
|
--[[
|
||||||
code for attaching tab key to maximizing player list
|
code for attaching tab key to maximizing player list
|
||||||
--]]
|
--]]
|
||||||
game.GuiService:AddKey "\t"
|
GuiService:AddKey "\t"
|
||||||
local LastTabTime = time()
|
local LastTabTime = time()
|
||||||
game.GuiService.KeyPressed:connect(function(key)
|
GuiService.KeyPressed:connect(function(key)
|
||||||
if key == "\t" then
|
if key == "\t" then
|
||||||
log "caught tab key"
|
log "caught tab key"
|
||||||
local modalCheck, isModal = pcall(function()
|
local modalCheck, isModal = pcall(function()
|
||||||
return game.GuiService.IsModalDialog
|
return GuiService.IsModalDialog
|
||||||
end)
|
end)
|
||||||
if modalCheck == false or (modalCheck and isModal == false) then
|
if
|
||||||
if time() - LastTabTime > 0.4 then
|
(modalCheck == false or (modalCheck and isModal == false))
|
||||||
LastTabTime = time()
|
and time() - LastTabTime > 0.4
|
||||||
if IsTabified.Value then
|
then
|
||||||
if not IsMaximized.Value then
|
LastTabTime = time()
|
||||||
ScreenGui:TweenPosition(
|
if IsTabified.Value then
|
||||||
UDim2.new(0, 0, 0, 0),
|
if not IsMaximized.Value then
|
||||||
"Out",
|
ScreenGui:TweenPosition(
|
||||||
"Linear",
|
UDim2.new(0, 0, 0, 0),
|
||||||
BASE_TWEEN * 1.2,
|
"Out",
|
||||||
true
|
"Linear",
|
||||||
)
|
BASE_TWEEN * 1.2,
|
||||||
IsMaximized.Value = true
|
true
|
||||||
else
|
)
|
||||||
ScreenGui:TweenPosition(
|
IsMaximized.Value = true
|
||||||
UDim2.new(
|
|
||||||
NormalBounds.X.Scale,
|
|
||||||
NormalBounds.X.Offset - 10,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
),
|
|
||||||
"Out",
|
|
||||||
"Linear",
|
|
||||||
BASE_TWEEN * 1.2,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
IsMaximized.Value = false
|
|
||||||
IsMinimized.Value = true
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
ToggleMaximize()
|
ScreenGui:TweenPosition(
|
||||||
|
UDim2.new(
|
||||||
|
NormalBounds.X.Scale,
|
||||||
|
NormalBounds.X.Offset - 10,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
),
|
||||||
|
"Out",
|
||||||
|
"Linear",
|
||||||
|
BASE_TWEEN * 1.2,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
IsMaximized.Value = false
|
||||||
|
IsMinimized.Value = true
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
ToggleMaximize()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -3337,16 +3331,16 @@ end
|
||||||
pcall(function()
|
pcall(function()
|
||||||
coreGuiChanged(
|
coreGuiChanged(
|
||||||
Enum.CoreGuiType.PlayerList,
|
Enum.CoreGuiType.PlayerList,
|
||||||
game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)
|
||||||
)
|
)
|
||||||
game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
while not game:GetService "Teams" do
|
while not game:GetService "Teams" do
|
||||||
RunService.Heartbeat:wait()
|
RunService.Heartbeat:wait()
|
||||||
log "Waiting For Teams"
|
log "Waiting For Teams"
|
||||||
end
|
end
|
||||||
for _, i in pairs(game.Teams:GetTeams()) do
|
for _, i in pairs(Teams:GetTeams()) do
|
||||||
TeamAdded(i)
|
TeamAdded(i)
|
||||||
end
|
end
|
||||||
for _, i in pairs(Players:GetPlayers()) do
|
for _, i in pairs(Players:GetPlayers()) do
|
||||||
|
|
@ -3385,8 +3379,8 @@ end
|
||||||
-- Hookups and initialization
|
-- Hookups and initialization
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
game.Teams.ChildAdded:connect(TeamsChildAdded)
|
Teams.ChildAdded:connect(TeamsChildAdded)
|
||||||
game.Teams.ChildRemoved:connect(TeamsChildRemoved)
|
Teams.ChildRemoved:connect(TeamsChildRemoved)
|
||||||
Players.ChildAdded:connect(PlayersChildAdded)
|
Players.ChildAdded:connect(PlayersChildAdded)
|
||||||
|
|
||||||
InitReportAbuse()
|
InitReportAbuse()
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,45 @@
|
||||||
|
--!strict
|
||||||
-- CoreGui.RobloxGui.CoreScripts/NotificationScript
|
-- CoreGui.RobloxGui.CoreScripts/NotificationScript
|
||||||
print "[Mercury]: Loaded corescript 48488398"
|
print "[Mercury]: Loaded corescript 48488398"
|
||||||
|
|
||||||
local GuiService = game:GetService "GuiService"
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
local TeleportService = game:GetService "TeleportService"
|
local TeleportService = game:GetService "TeleportService"
|
||||||
|
|
||||||
local function waitForProperty(instance, property)
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
|
local function waitForProperty(instance: Instance, property: string)
|
||||||
while not instance[property] do
|
while not instance[property] do
|
||||||
instance.Changed:wait()
|
instance.Changed:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function waitForChild(instance, name)
|
local function waitForChild(instance: Instance, name: string)
|
||||||
while not instance:FindFirstChild(name) do
|
while not instance:FindFirstChild(name) do
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
type Popup = Frame & {
|
||||||
waitForChild(script.Parent, "Popup")
|
AcceptButton: TextButton,
|
||||||
waitForChild(script.Parent.Popup, "AcceptButton")
|
OKButton: TextButton,
|
||||||
script.Parent.Popup.AcceptButton.Modal = true
|
DeclineButton: TextButton,
|
||||||
|
PopupText: TextLabel,
|
||||||
|
PopupImage: ImageLabel,
|
||||||
|
}
|
||||||
|
|
||||||
local localPlayer = game.Players.LocalPlayer
|
local gui = script.Parent :: ScreenGui
|
||||||
|
|
||||||
|
local function getPopup()
|
||||||
|
return gui:FindFirstChild "Popup" :: Popup
|
||||||
|
end
|
||||||
|
|
||||||
|
waitForProperty(Players, "LocalPlayer")
|
||||||
|
waitForChild(gui, "Popup")
|
||||||
|
waitForChild(getPopup(), "AcceptButton")
|
||||||
|
getPopup().AcceptButton.Modal = true
|
||||||
|
|
||||||
|
local localPlayer = Players.LocalPlayer
|
||||||
local teleportUI
|
local teleportUI
|
||||||
|
|
||||||
local friendRequestBlacklist = {}
|
local friendRequestBlacklist = {}
|
||||||
|
|
@ -28,31 +47,33 @@ local friendRequestBlacklist = {}
|
||||||
local teleportEnabled = true
|
local teleportEnabled = true
|
||||||
|
|
||||||
local function makePopupInvisible()
|
local function makePopupInvisible()
|
||||||
if script.Parent.Popup then
|
if getPopup() then
|
||||||
script.Parent.Popup.Visible = false
|
getPopup().Visible = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function showOneButton()
|
local function showOneButton()
|
||||||
local popup = script.Parent:FindFirstChild "Popup"
|
local popup = gui:FindFirstChild "Popup" :: Popup
|
||||||
if popup then
|
if not popup then
|
||||||
popup.OKButton.Visible = true
|
return
|
||||||
popup.DeclineButton.Visible = false
|
|
||||||
popup.AcceptButton.Visible = false
|
|
||||||
end
|
end
|
||||||
|
popup.OKButton.Visible = true
|
||||||
|
popup.DeclineButton.Visible = false
|
||||||
|
popup.AcceptButton.Visible = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function showTwoButtons()
|
local function showTwoButtons()
|
||||||
local popup = script.Parent:FindFirstChild "Popup"
|
local popup = gui:FindFirstChild "Popup" :: Popup
|
||||||
if popup then
|
if not popup then
|
||||||
popup.OKButton.Visible = false
|
return
|
||||||
popup.DeclineButton.Visible = true
|
|
||||||
popup.AcceptButton.Visible = true
|
|
||||||
end
|
end
|
||||||
|
popup.OKButton.Visible = false
|
||||||
|
popup.DeclineButton.Visible = true
|
||||||
|
popup.AcceptButton.Visible = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function makeFriend(fromPlayer, toPlayer)
|
local function makeFriend(fromPlayer, toPlayer)
|
||||||
local popup = script.Parent:FindFirstChild "Popup"
|
local popup = gui:FindFirstChild "Popup" :: Popup
|
||||||
if
|
if
|
||||||
popup == nil -- there is no popup!
|
popup == nil -- there is no popup!
|
||||||
or popup.Visible -- currently popping something, abort!
|
or popup.Visible -- currently popping something, abort!
|
||||||
|
|
@ -63,7 +84,7 @@ local function makeFriend(fromPlayer, toPlayer)
|
||||||
|
|
||||||
popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?`
|
popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?`
|
||||||
popup.PopupImage.Image =
|
popup.PopupImage.Image =
|
||||||
`http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=352&y=352`
|
path(`thumbs/avatar.ashx?userId={fromPlayer.userId}&x=352&y=352`)
|
||||||
|
|
||||||
showTwoButtons()
|
showTwoButtons()
|
||||||
popup.Visible = true
|
popup.Visible = true
|
||||||
|
|
@ -120,7 +141,9 @@ local function makeFriend(fromPlayer, toPlayer)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
|
Players.FriendRequestEvent:connect(function(fromPlr, toPlr, event)
|
||||||
|
local toPlayer = toPlr :: Player
|
||||||
|
local fromPlayer = fromPlr :: Player
|
||||||
-- if this doesn't involve me, then do nothing
|
-- if this doesn't involve me, then do nothing
|
||||||
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then
|
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then
|
||||||
return
|
return
|
||||||
|
|
@ -129,7 +152,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
|
||||||
GuiService:SendNotification(
|
GuiService:SendNotification(
|
||||||
"You are Friends",
|
"You are Friends",
|
||||||
`With {toPlayer.Name}!`,
|
`With {toPlayer.Name}!`,
|
||||||
`http://banland.xyz/thumbs/avatar.ashx?userId={toPlayer.userId}&x=48&y=48`,
|
path(`thumbs/avatar.ashx?userId={toPlayer.userId}&x=48&y=48`),
|
||||||
5,
|
5,
|
||||||
function() end
|
function() end
|
||||||
)
|
)
|
||||||
|
|
@ -142,7 +165,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
|
||||||
GuiService:SendNotification(
|
GuiService:SendNotification(
|
||||||
"Friend Request",
|
"Friend Request",
|
||||||
`From {fromPlayer.Name}`,
|
`From {fromPlayer.Name}`,
|
||||||
`http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`,
|
path(`thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`),
|
||||||
8,
|
8,
|
||||||
function()
|
function()
|
||||||
makeFriend(fromPlayer, toPlayer)
|
makeFriend(fromPlayer, toPlayer)
|
||||||
|
|
@ -152,7 +175,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
|
||||||
GuiService:SendNotification(
|
GuiService:SendNotification(
|
||||||
"You are Friends",
|
"You are Friends",
|
||||||
`With {fromPlayer.Name}!`,
|
`With {fromPlayer.Name}!`,
|
||||||
`http://banland.xyz/thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`,
|
path(`thumbs/avatar.ashx?userId={fromPlayer.userId}&x=48&y=48`),
|
||||||
5,
|
5,
|
||||||
function() end
|
function() end
|
||||||
)
|
)
|
||||||
|
|
@ -162,7 +185,7 @@ end)
|
||||||
|
|
||||||
local function showTeleportUI(message, timer)
|
local function showTeleportUI(message, timer)
|
||||||
if teleportUI ~= nil then
|
if teleportUI ~= nil then
|
||||||
teleportUI:Remove()
|
teleportUI:Destroy()
|
||||||
end
|
end
|
||||||
waitForChild(localPlayer, "PlayerGui")
|
waitForChild(localPlayer, "PlayerGui")
|
||||||
teleportUI = Instance.new "Message"
|
teleportUI = Instance.new "Message"
|
||||||
|
|
@ -170,7 +193,7 @@ local function showTeleportUI(message, timer)
|
||||||
teleportUI.Parent = localPlayer.PlayerGui
|
teleportUI.Parent = localPlayer.PlayerGui
|
||||||
if timer > 0 then
|
if timer > 0 then
|
||||||
wait(timer)
|
wait(timer)
|
||||||
teleportUI:Remove()
|
teleportUI:Destroy()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -195,7 +218,7 @@ if teleportEnabled then
|
||||||
localPlayer.OnTeleport:connect(onTeleport)
|
localPlayer.OnTeleport:connect(onTeleport)
|
||||||
|
|
||||||
function TeleportService.ErrorCallback(message)
|
function TeleportService.ErrorCallback(message)
|
||||||
local popup = script.Parent:FindFirstChild "Popup"
|
local popup = gui:FindFirstChild "Popup" :: Popup
|
||||||
showOneButton()
|
showOneButton()
|
||||||
popup.PopupText.Text = message
|
popup.PopupText.Text = message
|
||||||
local clickCon
|
local clickCon
|
||||||
|
|
@ -204,9 +227,7 @@ if teleportEnabled then
|
||||||
if clickCon then
|
if clickCon then
|
||||||
clickCon:disconnect()
|
clickCon:disconnect()
|
||||||
end
|
end
|
||||||
game.GuiService:RemoveCenterDialog(
|
GuiService:RemoveCenterDialog(gui:FindFirstChild "Popup" :: Popup)
|
||||||
script.Parent:FindFirstChild "Popup"
|
|
||||||
)
|
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 0, 0, 0),
|
UDim2.new(0, 0, 0, 0),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -216,13 +237,13 @@ if teleportEnabled then
|
||||||
makePopupInvisible()
|
makePopupInvisible()
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
script.Parent:FindFirstChild "Popup",
|
gui:FindFirstChild "Popup" :: Popup,
|
||||||
Enum.CenterDialogType.QuitDialog,
|
Enum.CenterDialogType.QuitDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
function()
|
function()
|
||||||
showOneButton()
|
showOneButton()
|
||||||
script.Parent:FindFirstChild("Popup").Visible = true
|
gui:FindFirstChild("Popup").Visible = true
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 330, 0, 350),
|
UDim2.new(0, 330, 0, 350),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -245,7 +266,7 @@ if teleportEnabled then
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
function TeleportService.ConfirmationCallback(message, placeId, spawnName)
|
function TeleportService.ConfirmationCallback(message, placeId, spawnName)
|
||||||
local popup = script.Parent:FindFirstChild "Popup"
|
local popup = getPopup()
|
||||||
popup.PopupText.Text = message
|
popup.PopupText.Text = message
|
||||||
popup.PopupImage.Image = ""
|
popup.PopupImage.Image = ""
|
||||||
|
|
||||||
|
|
@ -258,9 +279,7 @@ if teleportEnabled then
|
||||||
if noCon then
|
if noCon then
|
||||||
noCon:disconnect()
|
noCon:disconnect()
|
||||||
end
|
end
|
||||||
game.GuiService:RemoveCenterDialog(
|
GuiService:RemoveCenterDialog(getPopup())
|
||||||
script.Parent:FindFirstChild "Popup"
|
|
||||||
)
|
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 0, 0, 0),
|
UDim2.new(0, 0, 0, 0),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -284,9 +303,7 @@ if teleportEnabled then
|
||||||
if clickCon then
|
if clickCon then
|
||||||
clickCon:disconnect()
|
clickCon:disconnect()
|
||||||
end
|
end
|
||||||
game.GuiService:RemoveCenterDialog(
|
GuiService:RemoveCenterDialog(getPopup())
|
||||||
script.Parent:FindFirstChild "Popup"
|
|
||||||
)
|
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 0, 0, 0),
|
UDim2.new(0, 0, 0, 0),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -296,13 +313,13 @@ if teleportEnabled then
|
||||||
makePopupInvisible()
|
makePopupInvisible()
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
script.Parent:FindFirstChild "Popup",
|
getPopup(),
|
||||||
Enum.CenterDialogType.QuitDialog,
|
Enum.CenterDialogType.QuitDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
function()
|
function()
|
||||||
showOneButton()
|
showOneButton()
|
||||||
script.Parent:FindFirstChild("Popup").Visible = true
|
getPopup().Visible = true
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 330, 0, 350),
|
UDim2.new(0, 330, 0, 350),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -334,15 +351,15 @@ if teleportEnabled then
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local centerDialogSuccess = pcall(function()
|
local centerDialogSuccess = pcall(function()
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
script.Parent:FindFirstChild "Popup",
|
gui:FindFirstChild "Popup",
|
||||||
Enum.CenterDialogType.QuitDialog,
|
Enum.CenterDialogType.QuitDialog,
|
||||||
--ShowFunction
|
--ShowFunction
|
||||||
function()
|
function()
|
||||||
showTwoButtons()
|
showTwoButtons()
|
||||||
popup.AcceptButton.Text = "Leave"
|
popup.AcceptButton.Text = "Leave"
|
||||||
popup.DeclineButton.Text = "Stay"
|
popup.DeclineButton.Text = "Stay"
|
||||||
script.Parent:FindFirstChild("Popup").Visible = true
|
gui:FindFirstChild("Popup").Visible = true
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
UDim2.new(0, 330, 0, 350),
|
UDim2.new(0, 330, 0, 350),
|
||||||
Enum.EasingDirection.Out,
|
Enum.EasingDirection.Out,
|
||||||
|
|
@ -366,7 +383,7 @@ if teleportEnabled then
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if centerDialogSuccess == false then
|
if centerDialogSuccess == false then
|
||||||
script.Parent:FindFirstChild("Popup").Visible = true
|
gui:FindFirstChild("Popup").Visible = true
|
||||||
popup.AcceptButton.Text = "Leave"
|
popup.AcceptButton.Text = "Leave"
|
||||||
popup.DeclineButton.Text = "Stay"
|
popup.DeclineButton.Text = "Stay"
|
||||||
popup:TweenSize(
|
popup:TweenSize(
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
|
--!strict
|
||||||
-- CoreGui.RobloxGui.CoreScripts/PopupScript
|
-- CoreGui.RobloxGui.CoreScripts/PopupScript
|
||||||
print "[Mercury]: Loaded corescript 48488451"
|
print "[Mercury]: Loaded corescript 48488451"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
-- build our gui
|
-- build our gui
|
||||||
|
|
||||||
|
|
@ -25,7 +28,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 = path "asset?id=47574181",
|
||||||
ZIndex = 2,
|
ZIndex = 2,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -74,4 +77,4 @@ Hydrate(acceptButton:Clone()) {
|
||||||
Parent = popupFrame,
|
Parent = popupFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
script:remove()
|
script:Destroy()
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,33 @@
|
||||||
|
--!strict
|
||||||
-- CoreGui.RobloxGui.CoreScripts/BackpackScripts/BackpackBuild
|
-- CoreGui.RobloxGui.CoreScripts/BackpackScripts/BackpackBuild
|
||||||
print "[Mercury]: Loaded corescript 53878047"
|
print "[Mercury]: Loaded corescript 53878047"
|
||||||
|
|
||||||
|
local Players = game:GetService "Players"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
|
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
|
||||||
-- TODO: automate this process
|
-- TODO: automate this process
|
||||||
|
|
||||||
local gui = script.Parent
|
local gui = script.Parent :: ScreenGui & { ControlFrame: Frame }
|
||||||
|
|
||||||
-- A couple of necessary functions
|
-- A couple of necessary functions
|
||||||
local function waitForChild(instance, name)
|
local function waitForChild(instance: Instance, name: string)
|
||||||
while not instance:FindFirstChild(name) do
|
while not instance:FindFirstChild(name) do
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function waitForProperty(instance, property)
|
local function waitForProperty(instance: Instance, property: string)
|
||||||
while not instance[property] do
|
while not instance[property] do
|
||||||
instance.Changed:wait()
|
instance.Changed:wait()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
waitForChild(game, "Players")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
|
||||||
|
|
||||||
-- Components
|
-- Components
|
||||||
|
|
||||||
|
|
@ -73,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 = path "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,
|
||||||
|
|
@ -81,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 = path "asset?id=97662207",
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -101,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 = path "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 = path "asset?id=97643886",
|
||||||
-- Size = UDim2.new(1, 0, 1, 0),
|
-- Size = UDim2.new(1, 0, 1, 0),
|
||||||
-- Visible = false,
|
-- Visible = false,
|
||||||
-- }
|
-- }
|
||||||
|
|
@ -184,7 +188,7 @@ New "ImageButton" {
|
||||||
Visible = false,
|
Visible = false,
|
||||||
Name = "BackpackButton",
|
Name = "BackpackButton",
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=97617958",
|
Image = path "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,
|
||||||
|
|
@ -271,7 +275,7 @@ New "Frame" {
|
||||||
New "ImageLabel" {
|
New "ImageLabel" {
|
||||||
RobloxLocked = true,
|
RobloxLocked = true,
|
||||||
Name = "XImage",
|
Name = "XImage",
|
||||||
Image = "http://banland.xyz/asset?id=75547445",
|
Image = path "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),
|
||||||
|
|
@ -483,7 +487,7 @@ New "Frame" {
|
||||||
New "ImageLabel" {
|
New "ImageLabel" {
|
||||||
Name = "Background",
|
Name = "Background",
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=97613075",
|
Image = path "asset?id=97613075",
|
||||||
Size = UDim2.new(1, 0, 1, 0),
|
Size = UDim2.new(1, 0, 1, 0),
|
||||||
},
|
},
|
||||||
New "ObjectValue" {
|
New "ObjectValue" {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ print "[Mercury]: Loaded corescript 53878057"
|
||||||
|
|
||||||
local CoreGui = game:GetService "CoreGui"
|
local CoreGui = game:GetService "CoreGui"
|
||||||
local GuiService = game:GetService "GuiService"
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
|
local StarterGui = game:GetService "StarterGui"
|
||||||
local UserInputService = game:GetService "UserInputService"
|
local UserInputService = game:GetService "UserInputService"
|
||||||
|
|
||||||
-- A couple of necessary functions
|
-- A couple of necessary functions
|
||||||
|
|
@ -23,15 +25,15 @@ local currentLoadout = script.Parent
|
||||||
local StaticTabName = "gear"
|
local StaticTabName = "gear"
|
||||||
local backpackEnabled = true
|
local backpackEnabled = true
|
||||||
|
|
||||||
local mercuryGui = CoreGui:FindFirstChild "RobloxGui"
|
local MercuryGui = CoreGui:FindFirstChild "RobloxGui"
|
||||||
assert(mercuryGui)
|
assert(MercuryGui)
|
||||||
|
|
||||||
local controlFrame = waitForChild(mercuryGui, "ControlFrame")
|
local controlFrame = waitForChild(MercuryGui, "ControlFrame")
|
||||||
local backpackButton = waitForChild(controlFrame, "BackpackButton")
|
local backpackButton = waitForChild(controlFrame, "BackpackButton")
|
||||||
local backpack = waitForChild(mercuryGui, "Backpack")
|
local backpack = waitForChild(MercuryGui, "Backpack")
|
||||||
waitForChild(mercuryGui, "CurrentLoadout")
|
waitForChild(MercuryGui, "CurrentLoadout")
|
||||||
waitForChild(mercuryGui.CurrentLoadout, "TempSlot")
|
waitForChild(MercuryGui.CurrentLoadout, "TempSlot")
|
||||||
waitForChild(mercuryGui.CurrentLoadout.TempSlot, "SlotNumber")
|
waitForChild(MercuryGui.CurrentLoadout.TempSlot, "SlotNumber")
|
||||||
|
|
||||||
waitForChild(currentLoadout, "Background")
|
waitForChild(currentLoadout, "Background")
|
||||||
local clBackground = currentLoadout.Background
|
local clBackground = currentLoadout.Background
|
||||||
|
|
@ -59,9 +61,8 @@ local function setHealthBarVisible(pGui, visible)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Begin Locals
|
--- Begin Locals
|
||||||
waitForChild(game, "Players")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
local player = Players.LocalPlayer
|
||||||
local player = game.Players.LocalPlayer
|
|
||||||
|
|
||||||
waitForChild(player, "PlayerGui")
|
waitForChild(player, "PlayerGui")
|
||||||
Spawn(function()
|
Spawn(function()
|
||||||
|
|
@ -149,7 +150,7 @@ local function unregisterNumberKeys()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function characterInWorkspace()
|
local function characterInWorkspace()
|
||||||
local localPlayer = game.Players.LocalPlayer
|
local localPlayer = Players.LocalPlayer
|
||||||
return localPlayer
|
return localPlayer
|
||||||
and localPlayer.Character
|
and localPlayer.Character
|
||||||
and localPlayer.Character ~= nil
|
and localPlayer.Character ~= nil
|
||||||
|
|
@ -168,10 +169,10 @@ local function removeGear(gear)
|
||||||
if gearSlots[emptySlot].GearReference.Value then
|
if gearSlots[emptySlot].GearReference.Value then
|
||||||
if
|
if
|
||||||
gearSlots[emptySlot].GearReference.Value.Parent
|
gearSlots[emptySlot].GearReference.Value.Parent
|
||||||
== game.Players.LocalPlayer.Character
|
== Players.LocalPlayer.Character
|
||||||
then -- if we currently have this equipped, unequip it
|
then -- if we currently have this equipped, unequip it
|
||||||
gearSlots[emptySlot].GearReference.Value.Parent =
|
gearSlots[emptySlot].GearReference.Value.Parent =
|
||||||
game.Players.LocalPlayer.Backpack
|
Players.LocalPlayer.Backpack
|
||||||
end
|
end
|
||||||
|
|
||||||
if
|
if
|
||||||
|
|
@ -635,7 +636,7 @@ local function unequipAllItems(dontEquipThis)
|
||||||
gearSlots[i].GearReference.Value:Disable()
|
gearSlots[i].GearReference.Value:Disable()
|
||||||
elseif gearSlots[i].GearReference.Value:IsA "Tool" then
|
elseif gearSlots[i].GearReference.Value:IsA "Tool" then
|
||||||
gearSlots[i].GearReference.Value.Parent =
|
gearSlots[i].GearReference.Value.Parent =
|
||||||
game.Players.LocalPlayer.Backpack
|
Players.LocalPlayer.Backpack
|
||||||
end
|
end
|
||||||
gearSlots[i].Selected = false
|
gearSlots[i].Selected = false
|
||||||
end
|
end
|
||||||
|
|
@ -885,7 +886,7 @@ local function addingPlayerChild(
|
||||||
childChangeCon:disconnect()
|
childChangeCon:disconnect()
|
||||||
end
|
end
|
||||||
removeFromInventory(child)
|
removeFromInventory(child)
|
||||||
elseif newParent == game.Players.LocalPlayer.Backpack then
|
elseif newParent == Players.LocalPlayer.Backpack then
|
||||||
normaliseButton(gearClone)
|
normaliseButton(gearClone)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
@ -1070,7 +1071,7 @@ local function coreGuiChanged(coreGuiType, enabled)
|
||||||
coreGuiType == Enum.CoreGuiType.Health
|
coreGuiType == Enum.CoreGuiType.Health
|
||||||
or coreGuiType == Enum.CoreGuiType.All
|
or coreGuiType == Enum.CoreGuiType.All
|
||||||
then
|
then
|
||||||
setHealthBarVisible(game.Players.LocalPlayer.PlayerGui, enabled)
|
setHealthBarVisible(Players.LocalPlayer.PlayerGui, enabled)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- End Functions
|
-- End Functions
|
||||||
|
|
@ -1081,13 +1082,13 @@ registerNumberKeys()
|
||||||
pcall(function()
|
pcall(function()
|
||||||
coreGuiChanged(
|
coreGuiChanged(
|
||||||
Enum.CoreGuiType.Backpack,
|
Enum.CoreGuiType.Backpack,
|
||||||
game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
||||||
)
|
)
|
||||||
coreGuiChanged(
|
coreGuiChanged(
|
||||||
Enum.CoreGuiType.Health,
|
Enum.CoreGuiType.Health,
|
||||||
game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
|
||||||
)
|
)
|
||||||
game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbeat...
|
RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbeat...
|
||||||
|
|
@ -1147,8 +1148,8 @@ player.CharacterRemoving:connect(function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
player.CharacterAdded:connect(function()
|
player.CharacterAdded:connect(function()
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
player = game.Players.LocalPlayer -- make sure we are still looking at the correct character
|
player = Players.LocalPlayer -- make sure we are still looking at the correct character
|
||||||
waitForChild(player, "Backpack")
|
waitForChild(player, "Backpack")
|
||||||
|
|
||||||
delay(1, function()
|
delay(1, function()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
-- RbxUtility
|
-- RbxUtility
|
||||||
print "[Mercury]: Loaded corescript 60595411"
|
print "[Mercury]: Loaded corescript 60595411"
|
||||||
|
|
||||||
|
|
@ -5,7 +6,7 @@ local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
|
||||||
local Terrain = game:GetService "Terrain"
|
local Terrain = workspace.Terrain
|
||||||
|
|
||||||
local RbxUtility = {}
|
local RbxUtility = {}
|
||||||
|
|
||||||
|
|
@ -30,7 +31,7 @@ end
|
||||||
-- sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w
|
-- sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w
|
||||||
-- returns true if made a wedge, false if the cell remains a block
|
-- returns true if made a wedge, false if the cell remains a block
|
||||||
function RbxUtility.MakeWedge(x, y, z, _)
|
function RbxUtility.MakeWedge(x, y, z, _)
|
||||||
return Terrain:AutoWedgeCell(x, y, z)
|
return Terrain:AutowedgeCell(x, y, z)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RbxUtility.SelectTerrainRegion(
|
function RbxUtility.SelectTerrainRegion(
|
||||||
|
|
@ -80,7 +81,15 @@ function RbxUtility.SelectTerrainRegion(
|
||||||
local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed
|
local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed
|
||||||
local aliveCounter = 0 -- helper for currentKeepAliveTag
|
local aliveCounter = 0 -- helper for currentKeepAliveTag
|
||||||
local lastRegion -- used to stop updates that do nothing
|
local lastRegion -- used to stop updates that do nothing
|
||||||
local adornments = {} -- contains all adornments
|
local adornments: {
|
||||||
|
[Vector3int16]: {
|
||||||
|
SelectionPart: BasePart,
|
||||||
|
SelectionBox: SelectionBox,
|
||||||
|
KeepAlive: number,
|
||||||
|
},
|
||||||
|
SelectionPart: BasePart?,
|
||||||
|
SelectionBox: SelectionBox?,
|
||||||
|
} = {} -- contains all adornments
|
||||||
local reusableAdorns = {}
|
local reusableAdorns = {}
|
||||||
|
|
||||||
local selectionPart = New "Part" {
|
local selectionPart = New "Part" {
|
||||||
|
|
@ -146,7 +155,7 @@ function RbxUtility.SelectTerrainRegion(
|
||||||
end
|
end
|
||||||
|
|
||||||
-- finds full cells in region and adorns each cell with a box, with the argument color
|
-- finds full cells in region and adorns each cell with a box, with the argument color
|
||||||
local function adornFullCellsInRegion(region, newColour)
|
local function adornFullCellsInRegion(region: Region3, newColour: BrickColor)
|
||||||
local regionBegin = region.CFrame.p
|
local regionBegin = region.CFrame.p
|
||||||
- (region.Size / 2)
|
- (region.Size / 2)
|
||||||
+ Vector3.new(2, 2, 2)
|
+ Vector3.new(2, 2, 2)
|
||||||
|
|
@ -158,9 +167,9 @@ function RbxUtility.SelectTerrainRegion(
|
||||||
local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
|
local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
|
||||||
|
|
||||||
currentKeepAliveTag = incrementAliveCounter()
|
currentKeepAliveTag = incrementAliveCounter()
|
||||||
for y = cellPosBegin.y, cellPosEnd.y do
|
for y = cellPosBegin.Y, cellPosEnd.Y do
|
||||||
for z = cellPosBegin.z, cellPosEnd.z do
|
for z = cellPosBegin.Z, cellPosEnd.Z do
|
||||||
for x = cellPosBegin.x, cellPosEnd.x do
|
for x = cellPosBegin.X, cellPosEnd.X do
|
||||||
local cellMaterial = GetCell(terrain, x, y, z)
|
local cellMaterial = GetCell(terrain, x, y, z)
|
||||||
|
|
||||||
if cellMaterial ~= emptyMaterial then
|
if cellMaterial ~= emptyMaterial then
|
||||||
|
|
@ -222,7 +231,7 @@ function RbxUtility.SelectTerrainRegion(
|
||||||
end
|
end
|
||||||
else -- use individual cell adorns to represent the area selected
|
else -- use individual cell adorns to represent the area selected
|
||||||
adornFullCellsInRegion(regionToSelect, colour)
|
adornFullCellsInRegion(regionToSelect, colour)
|
||||||
function updateSelection(newRegion, newColour)
|
function updateSelection(newRegion: Region3, newColour)
|
||||||
if newRegion and newRegion ~= lastRegion then
|
if newRegion and newRegion ~= lastRegion then
|
||||||
lastRegion = newRegion
|
lastRegion = newRegion
|
||||||
adornFullCellsInRegion(newRegion, newColour)
|
adornFullCellsInRegion(newRegion, newColour)
|
||||||
|
|
@ -433,9 +442,18 @@ Note: It is also perfectly legal to save a reference to the function returned by
|
||||||
local part = partCreatingFunction()
|
local part = partCreatingFunction()
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it
|
local Create_PrivImpl
|
||||||
--will be created in several steps rather than as a single function declaration.
|
|
||||||
local function Create_PrivImpl(objectType: string)
|
-- create the functor:
|
||||||
|
RbxUtility.Create = setmetatable({}, {
|
||||||
|
__call = function(_, ...)
|
||||||
|
return Create_PrivImpl(...)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it
|
||||||
|
-- will be created in several steps rather than as a single function declaration.
|
||||||
|
function Create_PrivImpl(objectType: string)
|
||||||
if type(objectType) ~= "string" then
|
if type(objectType) ~= "string" then
|
||||||
error("Argument of Create must be a string", 2)
|
error("Argument of Create must be a string", 2)
|
||||||
end
|
end
|
||||||
|
|
@ -518,12 +536,7 @@ local function Create_PrivImpl(objectType: string)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--now, create the functor:
|
|
||||||
RbxUtility.Create = setmetatable({}, {
|
|
||||||
__call = function(_, ...)
|
|
||||||
return Create_PrivImpl(...)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
--and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create
|
--and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create
|
||||||
--function can recognize as special.
|
--function can recognize as special.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
-- Script Context./Libraries/LibraryRegistration/LibraryRegist
|
-- Script Context./Libraries/LibraryRegistration/LibraryRegist
|
||||||
print "[Mercury]: Loaded corescript 60595695"
|
print "[Mercury]: Loaded corescript 60595695"
|
||||||
|
|
||||||
|
|
@ -17,18 +18,19 @@ for _ = 1, 4 do
|
||||||
RunService.Heartbeat:wait()
|
RunService.Heartbeat:wait()
|
||||||
end
|
end
|
||||||
|
|
||||||
if ScriptContext then
|
if not ScriptContext then
|
||||||
for name, id in pairs {
|
|
||||||
Fusion = 10000001,
|
|
||||||
Red = 10000002,
|
|
||||||
Load = 10000003,
|
|
||||||
Gui = 45284430,
|
|
||||||
Utility = 60595411,
|
|
||||||
Stamper = 73157242,
|
|
||||||
} do
|
|
||||||
ScriptContext:RegisterLibrary("Libraries/Rbx" .. name, tostring(id))
|
|
||||||
end
|
|
||||||
ScriptContext:LibraryRegistrationComplete()
|
|
||||||
else
|
|
||||||
print "[Mercury]: Failed to find ScriptContext, libraries did not load"
|
print "[Mercury]: Failed to find ScriptContext, libraries did not load"
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for name, id in pairs {
|
||||||
|
Fusion = 10000001,
|
||||||
|
Red = 10000002,
|
||||||
|
Load = 10000003,
|
||||||
|
Gui = 45284430,
|
||||||
|
Utility = 60595411,
|
||||||
|
Stamper = 73157242,
|
||||||
|
} do
|
||||||
|
ScriptContext:RegisterLibrary("Libraries/Rbx" .. name, tostring(id))
|
||||||
|
end
|
||||||
|
ScriptContext:LibraryRegistrationComplete()
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,15 @@ print "[Mercury]: Loaded corescript 73157242"
|
||||||
|
|
||||||
local ChangeHistoryService = game:GetService "ChangeHistoryService"
|
local ChangeHistoryService = game:GetService "ChangeHistoryService"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
|
local JointsService = game:GetService "JointsService"
|
||||||
|
local Lighting = game:GetService "Lighting"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
local RbxStamper = {}
|
local RbxStamper = {}
|
||||||
|
|
||||||
|
|
@ -436,9 +441,7 @@ local function isBlocker(part: Instance) -- returns whether or not we want to ca
|
||||||
or part:FindFirstChild "RobloxModel"
|
or part:FindFirstChild "RobloxModel"
|
||||||
then
|
then
|
||||||
return true
|
return true
|
||||||
elseif
|
elseif (part:IsA "Part" and not part.CanCollide) or (part == Lighting) then
|
||||||
(part:IsA "Part" and not part.CanCollide) or (part == game.Lighting)
|
|
||||||
then
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return isBlocker(part.Parent)
|
return isBlocker(part.Parent)
|
||||||
|
|
@ -844,7 +847,7 @@ local function setupFakeTerrainPart(cellMat, cellType, cellOrient)
|
||||||
if cellType == 3 then
|
if cellType == 3 then
|
||||||
New "SpecialMesh" {
|
New "SpecialMesh" {
|
||||||
MeshType = "FileMesh",
|
MeshType = "FileMesh",
|
||||||
MeshId = "http://banland.xyz/asset?id=66832495",
|
MeshId = path "asset?id=66832495",
|
||||||
Scale = Vector3.new(2, 2, 2),
|
Scale = Vector3.new(2, 2, 2),
|
||||||
Parent = newTerrainPiece,
|
Parent = newTerrainPiece,
|
||||||
}
|
}
|
||||||
|
|
@ -1116,8 +1119,8 @@ local function DoHighScalabilityRegionSelect(
|
||||||
-- make player able to see this ish
|
-- make player able to see this ish
|
||||||
|
|
||||||
local gui
|
local gui
|
||||||
if game.Players.LocalPlayer then
|
if Players.LocalPlayer then
|
||||||
gui = game.Players.LocalPlayer:FindFirstChild "PlayerGui"
|
gui = Players.LocalPlayer:FindFirstChild "PlayerGui"
|
||||||
if
|
if
|
||||||
gui
|
gui
|
||||||
and gui:IsA "PlayerGui"
|
and gui:IsA "PlayerGui"
|
||||||
|
|
@ -1148,10 +1151,10 @@ local function flashRedBox(stampData: {
|
||||||
local gui = game.CoreGui
|
local gui = game.CoreGui
|
||||||
if
|
if
|
||||||
game:FindFirstChild "Players"
|
game:FindFirstChild "Players"
|
||||||
and game.Players.LocalPlayer
|
and Players.LocalPlayer
|
||||||
and game.Players.LocalPlayer:FindFirstChild "PlayerGui"
|
and Players.LocalPlayer:FindFirstChild "PlayerGui"
|
||||||
then
|
then
|
||||||
gui = game.Players.LocalPlayer.PlayerGui
|
gui = Players.LocalPlayer.PlayerGui
|
||||||
end
|
end
|
||||||
if not stampData.ErrorBox then
|
if not stampData.ErrorBox then
|
||||||
return
|
return
|
||||||
|
|
@ -1872,7 +1875,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
if modelInfo then
|
if modelInfo then
|
||||||
hitFace = modelTargetSurface(
|
hitFace = modelTargetSurface(
|
||||||
modelInfo.Parent,
|
modelInfo.Parent,
|
||||||
workspace.CurrentCamera.CoordinateFrame.p,
|
(workspace.CurrentCamera :: Camera).CoordinateFrame.p,
|
||||||
mouse.Hit.p
|
mouse.Hit.p
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
@ -1882,7 +1885,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
if hitFace == tonumber(bf) then
|
if hitFace == tonumber(bf) then
|
||||||
-- return before we hit the JointsService code below!
|
-- return before we hit the JointsService code below!
|
||||||
unstampableSurface = true
|
unstampableSurface = true
|
||||||
game.JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache
|
JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1891,14 +1894,14 @@ function RbxStamper.SetupStamperDragger(
|
||||||
hitFace = modelTargetSurface(
|
hitFace = modelTargetSurface(
|
||||||
stampData.CurrentParts,
|
stampData.CurrentParts,
|
||||||
mouse.Hit.p,
|
mouse.Hit.p,
|
||||||
workspace.CurrentCamera.CoordinateFrame.p
|
(workspace.CurrentCamera :: Camera).CoordinateFrame.p
|
||||||
)
|
)
|
||||||
|
|
||||||
-- are we stamping WITH an unstampable surface?
|
-- are we stamping WITH an unstampable surface?
|
||||||
for bf in string.gmatch(myBreakingFaces, "[^,]+") do
|
for bf in string.gmatch(myBreakingFaces, "[^,]+") do
|
||||||
if hitFace == tonumber(bf) then
|
if hitFace == tonumber(bf) then
|
||||||
unstampableSurface = true
|
unstampableSurface = true
|
||||||
game.JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache
|
JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1910,7 +1913,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
|
|
||||||
-- to show joints during the mouse move
|
-- to show joints during the mouse move
|
||||||
unstampableSurface = false
|
unstampableSurface = false
|
||||||
game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts)
|
JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts)
|
||||||
|
|
||||||
-- most common mouse inactive error occurs here, so check mouse active one more time in a pcall
|
-- most common mouse inactive error occurs here, so check mouse active one more time in a pcall
|
||||||
local ok = pcall(function()
|
local ok = pcall(function()
|
||||||
|
|
@ -1919,7 +1922,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
and not mouse.Target.Parent:FindFirstChild "RobloxModel"
|
and not mouse.Target.Parent:FindFirstChild "RobloxModel"
|
||||||
end)
|
end)
|
||||||
if not ok then
|
if not ok then
|
||||||
game.JointsService:ClearJoinAfterMoveJoints()
|
JointsService:ClearJoinAfterMoveJoints()
|
||||||
mouse = nil
|
mouse = nil
|
||||||
error "Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check"
|
error "Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check"
|
||||||
return
|
return
|
||||||
|
|
@ -1930,11 +1933,11 @@ function RbxStamper.SetupStamperDragger(
|
||||||
and mouse.Target
|
and mouse.Target
|
||||||
and mouse.Target.Parent:FindFirstChild "RobloxModel" == nil
|
and mouse.Target.Parent:FindFirstChild "RobloxModel" == nil
|
||||||
then
|
then
|
||||||
game.JointsService:SetJoinAfterMoveTarget(mouse.Target)
|
JointsService:SetJoinAfterMoveTarget(mouse.Target)
|
||||||
else
|
else
|
||||||
game.JointsService:SetJoinAfterMoveTarget(nil)
|
JointsService:SetJoinAfterMoveTarget(nil)
|
||||||
end
|
end
|
||||||
game.JointsService:ShowPermissibleJoints()
|
JointsService:ShowPermissibleJoints()
|
||||||
|
|
||||||
-- here we allow for a line of high-scalability parts
|
-- here we allow for a line of high-scalability parts
|
||||||
if
|
if
|
||||||
|
|
@ -2214,7 +2217,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
end
|
end
|
||||||
|
|
||||||
-- to show joints during the mouse move
|
-- to show joints during the mouse move
|
||||||
game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts)
|
JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts)
|
||||||
|
|
||||||
return clone, parts
|
return clone, parts
|
||||||
end
|
end
|
||||||
|
|
@ -2377,11 +2380,11 @@ function RbxStamper.SetupStamperDragger(
|
||||||
-- something will be stamped! so set the "StampedSomething" toggle to true
|
-- something will be stamped! so set the "StampedSomething" toggle to true
|
||||||
if
|
if
|
||||||
game:FindFirstChild "Players"
|
game:FindFirstChild "Players"
|
||||||
and game.Players.LocalPlayer
|
and Players.LocalPlayer
|
||||||
and game.Players.LocalPlayer.Character
|
and Players.LocalPlayer.Character
|
||||||
then
|
then
|
||||||
local stampTracker =
|
local stampTracker =
|
||||||
game.Players.LocalPlayer.Character:FindFirstChild "StampTracker"
|
Players.LocalPlayer.Character:FindFirstChild "StampTracker"
|
||||||
if stampTracker and not stampTracker.Value then
|
if stampTracker and not stampTracker.Value then
|
||||||
stampTracker.Value = true
|
stampTracker.Value = true
|
||||||
end
|
end
|
||||||
|
|
@ -2534,8 +2537,8 @@ function RbxStamper.SetupStamperDragger(
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getPlayer()
|
local function getPlayer()
|
||||||
if game:FindFirstChild "Players" and game.Players.LocalPlayer then
|
if game:FindFirstChild "Players" and Players.LocalPlayer then
|
||||||
return game.Players.LocalPlayer
|
return Players.LocalPlayer
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
@ -2575,9 +2578,9 @@ function RbxStamper.SetupStamperDragger(
|
||||||
if
|
if
|
||||||
playerNameTag
|
playerNameTag
|
||||||
and game:FindFirstChild "Players"
|
and game:FindFirstChild "Players"
|
||||||
and game.Players.LocalPlayer
|
and Players.LocalPlayer
|
||||||
then
|
then
|
||||||
tempPlayerValue = game.Players.LocalPlayer
|
tempPlayerValue = Players.LocalPlayer
|
||||||
if tempPlayerValue then
|
if tempPlayerValue then
|
||||||
playerNameTag.Value = tempPlayerValue.Name
|
playerNameTag.Value = tempPlayerValue.Name
|
||||||
end
|
end
|
||||||
|
|
@ -2611,7 +2614,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
|
|
||||||
-- make sure all the joints are activated before restoring anchor states
|
-- make sure all the joints are activated before restoring anchor states
|
||||||
-- if not createJoints then
|
-- if not createJoints then
|
||||||
game.JointsService:CreateJoinAfterMoveJoints()
|
JointsService:CreateJoinAfterMoveJoints()
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- Restore the original properties for all parts being stamped
|
-- Restore the original properties for all parts being stamped
|
||||||
|
|
@ -2702,7 +2705,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
|
|
||||||
resetHighScalabilityLine()
|
resetHighScalabilityLine()
|
||||||
|
|
||||||
game.JointsService:ClearJoinAfterMoveJoints()
|
JointsService:ClearJoinAfterMoveJoints()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function prepareUnjoinableSurfaces(modelCFrame, parts, whichSurface)
|
local function prepareUnjoinableSurfaces(modelCFrame, parts, whichSurface)
|
||||||
|
|
@ -2815,11 +2818,11 @@ function RbxStamper.SetupStamperDragger(
|
||||||
mouseTarget
|
mouseTarget
|
||||||
and mouseTarget.Parent:FindFirstChild "RobloxModel" == nil
|
and mouseTarget.Parent:FindFirstChild "RobloxModel" == nil
|
||||||
then
|
then
|
||||||
game.JointsService:SetJoinAfterMoveTarget(mouseTarget)
|
JointsService:SetJoinAfterMoveTarget(mouseTarget)
|
||||||
else
|
else
|
||||||
game.JointsService:SetJoinAfterMoveTarget(nil)
|
JointsService:SetJoinAfterMoveTarget(nil)
|
||||||
end
|
end
|
||||||
game.JointsService:ShowPermissibleJoints()
|
JointsService:ShowPermissibleJoints()
|
||||||
|
|
||||||
for _, object in pairs(stampData.DisabledScripts) do
|
for _, object in pairs(stampData.DisabledScripts) do
|
||||||
if object.Name == "GhostRemovalScript" then
|
if object.Name == "GhostRemovalScript" then
|
||||||
|
|
@ -2905,6 +2908,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
resetStamperState(newStampModel)
|
resetStamperState(newStampModel)
|
||||||
|
return -- bruh
|
||||||
end
|
end
|
||||||
|
|
||||||
function control.ReloadModel() -- will automatically set stamper to get a new model of current model and start stamping with new model
|
function control.ReloadModel() -- will automatically set stamper to get a new model of current model and start stamping with new model
|
||||||
|
|
@ -2945,7 +2949,7 @@ function RbxStamper.SetupStamperDragger(
|
||||||
keyCon:disconnect()
|
keyCon:disconnect()
|
||||||
end
|
end
|
||||||
|
|
||||||
game.JointsService:ClearJoinAfterMoveJoints()
|
JointsService:ClearJoinAfterMoveJoints()
|
||||||
|
|
||||||
if adorn then
|
if adorn then
|
||||||
adorn:Destroy()
|
adorn:Destroy()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
-- 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 Players = game:GetService "Players"
|
||||||
|
local StarterGui = game:GetService "StarterGui"
|
||||||
local UserInputService = game:GetService "UserInputService"
|
local UserInputService = game:GetService "UserInputService"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
|
|
@ -30,8 +32,8 @@ local function IsTouchDevice()
|
||||||
end
|
end
|
||||||
|
|
||||||
waitForChild(game, "Players")
|
waitForChild(game, "Players")
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
local player = game.Players.LocalPlayer
|
local player = Players.LocalPlayer
|
||||||
|
|
||||||
local RbxGui, _ = LoadLibrary "RbxGui"
|
local RbxGui, _ = LoadLibrary "RbxGui"
|
||||||
if not RbxGui then
|
if not RbxGui then
|
||||||
|
|
@ -69,10 +71,10 @@ local currentLoadout = waitForChild(backpack.Parent, "CurrentLoadout")
|
||||||
local grid = waitForChild(backpack.Gear, "GearGrid")
|
local grid = waitForChild(backpack.Gear, "GearGrid")
|
||||||
local gearButton = waitForChild(grid, "GearButton")
|
local gearButton = waitForChild(grid, "GearButton")
|
||||||
|
|
||||||
local swapSlot = waitForChild(script.Parent, "SwapSlot")
|
local swapSlot = waitForChild(backpack, "SwapSlot")
|
||||||
|
|
||||||
local backpackManager =
|
local backpackManager =
|
||||||
waitForChild(script.Parent, "CoreScripts/BackpackScripts/BackpackManager")
|
waitForChild(backpack, "CoreScripts/BackpackScripts/BackpackManager")
|
||||||
local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent")
|
local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent")
|
||||||
local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
|
local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
|
||||||
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
|
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
|
||||||
|
|
@ -741,14 +743,14 @@ local function setupCharacterConnections()
|
||||||
if backpackAddCon then
|
if backpackAddCon then
|
||||||
backpackAddCon:disconnect()
|
backpackAddCon:disconnect()
|
||||||
end
|
end
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
|
backpackAddCon = Players.LocalPlayer.Backpack.ChildAdded:connect(
|
||||||
function(child)
|
function(child)
|
||||||
addToGrid(child)
|
addToGrid(child)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
-- make sure we get all the children
|
-- make sure we get all the children
|
||||||
local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren()
|
local backpackChildren = Players.LocalPlayer.Backpack:GetChildren()
|
||||||
for i = 1, #backpackChildren do
|
for i = 1, #backpackChildren do
|
||||||
addToGrid(backpackChildren[i])
|
addToGrid(backpackChildren[i])
|
||||||
end
|
end
|
||||||
|
|
@ -756,7 +758,7 @@ local function setupCharacterConnections()
|
||||||
if characterChildAddedCon then
|
if characterChildAddedCon then
|
||||||
characterChildAddedCon:disconnect()
|
characterChildAddedCon:disconnect()
|
||||||
end
|
end
|
||||||
characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(
|
characterChildAddedCon = Players.LocalPlayer.Character.ChildAdded:connect(
|
||||||
function(child)
|
function(child)
|
||||||
addToGrid(child)
|
addToGrid(child)
|
||||||
updateGridActive()
|
updateGridActive()
|
||||||
|
|
@ -766,7 +768,7 @@ local function setupCharacterConnections()
|
||||||
if characterChildRemovedCon then
|
if characterChildRemovedCon then
|
||||||
characterChildRemovedCon:disconnect()
|
characterChildRemovedCon:disconnect()
|
||||||
end
|
end
|
||||||
characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(
|
characterChildRemovedCon = Players.LocalPlayer.Character.ChildRemoved:connect(
|
||||||
function(_)
|
function(_)
|
||||||
updateGridActive()
|
updateGridActive()
|
||||||
end
|
end
|
||||||
|
|
@ -934,7 +936,7 @@ player.ChildAdded:connect(function(child)
|
||||||
if backpackAddCon then
|
if backpackAddCon then
|
||||||
backpackAddCon:disconnect()
|
backpackAddCon:disconnect()
|
||||||
end
|
end
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
|
backpackAddCon = Players.LocalPlayer.Backpack.ChildAdded:connect(
|
||||||
function(child2)
|
function(child2)
|
||||||
addToGrid(child2)
|
addToGrid(child2)
|
||||||
end
|
end
|
||||||
|
|
@ -967,9 +969,9 @@ end
|
||||||
pcall(function()
|
pcall(function()
|
||||||
coreGuiChanged(
|
coreGuiChanged(
|
||||||
Enum.CoreGuiType.Backpack,
|
Enum.CoreGuiType.Backpack,
|
||||||
game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
||||||
)
|
)
|
||||||
game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
resize()
|
resize()
|
||||||
|
|
@ -985,11 +987,11 @@ if not backpack.Visible then
|
||||||
end
|
end
|
||||||
|
|
||||||
-- make sure that inventory is listening to gear reparenting
|
-- make sure that inventory is listening to gear reparenting
|
||||||
if characterChildAddedCon == nil and game.Players.LocalPlayer.Character then
|
if characterChildAddedCon == nil and Players.LocalPlayer.Character then
|
||||||
setupCharacterConnections()
|
setupCharacterConnections()
|
||||||
end
|
end
|
||||||
if not backpackAddCon then
|
if not backpackAddCon then
|
||||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
|
backpackAddCon = Players.LocalPlayer.Backpack.ChildAdded:connect(
|
||||||
function(child)
|
function(child)
|
||||||
addToGrid(child)
|
addToGrid(child)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,28 @@
|
||||||
|
--!strict
|
||||||
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (2?)
|
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (2?)
|
||||||
print "[Mercury]: Loaded corescript 89449093"
|
print "[Mercury]: Loaded corescript 89449093"
|
||||||
|
|
||||||
|
local CoreGui = game:GetService "CoreGui"
|
||||||
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
|
local StarterGui = game:GetService "StarterGui"
|
||||||
|
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
local GuiService = game:GetService "GuiService"
|
local path = BaseUrl.path
|
||||||
|
|
||||||
-- basic functions
|
-- basic functions
|
||||||
local function waitForChild(instance, name)
|
local function waitForChild(instance: Instance, name: string)
|
||||||
while not instance:FindFirstChild(name) do
|
local child = instance:FindFirstChild(name)
|
||||||
|
while not child do
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
|
child = instance:FindFirstChild(name)
|
||||||
end
|
end
|
||||||
return instance:FindFirstChild(name)
|
return child :: Instance
|
||||||
end
|
end
|
||||||
local function waitForProperty(instance, property)
|
local function waitForProperty(instance: Instance, property: string)
|
||||||
while not instance[property] do
|
while not instance[property] do
|
||||||
instance.Changed:wait()
|
instance.Changed:wait()
|
||||||
end
|
end
|
||||||
|
|
@ -22,12 +30,12 @@ end
|
||||||
|
|
||||||
-- don't do anything if we are in an empty game
|
-- don't do anything if we are in an empty game
|
||||||
waitForChild(game, "Players")
|
waitForChild(game, "Players")
|
||||||
if #game.Players:GetChildren() < 1 then
|
if #Players:GetChildren() < 1 then
|
||||||
game.Players.ChildAdded:wait()
|
Players.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
-- make sure everything is loaded in before we do anything
|
-- make sure everything is loaded in before we do anything
|
||||||
-- get our local player
|
-- get our local player
|
||||||
waitForProperty(game.Players, "LocalPlayer")
|
waitForProperty(Players, "LocalPlayer")
|
||||||
|
|
||||||
------------------------ Locals ------------------------------
|
------------------------ Locals ------------------------------
|
||||||
local backpack = script.Parent :: GuiObject
|
local backpack = script.Parent :: GuiObject
|
||||||
|
|
@ -53,8 +61,8 @@ local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame, "SearchBox")
|
||||||
local searchButton = waitForChild(backpack.SearchFrame, "SearchButton")
|
local searchButton = waitForChild(backpack.SearchFrame, "SearchButton")
|
||||||
local resetButton = waitForChild(backpack.SearchFrame, "ResetButton")
|
local resetButton = waitForChild(backpack.SearchFrame, "ResetButton")
|
||||||
|
|
||||||
local mercuryGui = waitForChild(game.CoreGui, "RobloxGui")
|
local MercuryGui = waitForChild(CoreGui, "RobloxGui")
|
||||||
local currentLoadout = waitForChild(mercuryGui, "CurrentLoadout")
|
local currentLoadout = waitForChild(MercuryGui, "CurrentLoadout")
|
||||||
local loadoutBackground = waitForChild(currentLoadout, "Background")
|
local loadoutBackground = waitForChild(currentLoadout, "Background")
|
||||||
|
|
||||||
local canToggle = true
|
local canToggle = true
|
||||||
|
|
@ -111,15 +119,15 @@ local function initHumanoidDiedConnections()
|
||||||
if humanoidDiedCon then
|
if humanoidDiedCon then
|
||||||
humanoidDiedCon:disconnect()
|
humanoidDiedCon:disconnect()
|
||||||
end
|
end
|
||||||
waitForProperty(game.Players.LocalPlayer, "Character")
|
waitForProperty(Players.LocalPlayer, "Character")
|
||||||
local localPlayer = game.Players.LocalPlayer
|
local localPlayer = Players.LocalPlayer
|
||||||
waitForChild(localPlayer.Character, "Humanoid")
|
waitForChild(localPlayer.Character, "Humanoid")
|
||||||
humanoidDiedCon =
|
humanoidDiedCon =
|
||||||
localPlayer.Character.Humanoid.Died:connect(deactivateBackpack)
|
localPlayer.Character.Humanoid.Died:connect(deactivateBackpack)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function showBackpack()
|
local function showBackpack()
|
||||||
game.GuiService:AddCenterDialog(
|
GuiService:AddCenterDialog(
|
||||||
backpack,
|
backpack,
|
||||||
Enum.CenterDialogType.PlayerInitiatedDialog,
|
Enum.CenterDialogType.PlayerInitiatedDialog,
|
||||||
function()
|
function()
|
||||||
|
|
@ -152,7 +160,7 @@ 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 = path "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)
|
||||||
|
|
@ -184,13 +192,13 @@ local function hideBackpack()
|
||||||
guiTweenSpeed,
|
guiTweenSpeed,
|
||||||
true,
|
true,
|
||||||
function()
|
function()
|
||||||
game.GuiService:RemoveCenterDialog(backpack)
|
GuiService:RemoveCenterDialog(backpack)
|
||||||
backpack.Visible = false
|
backpack.Visible = false
|
||||||
backpackButton.Selected = false
|
backpackButton.Selected = false
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
delay(guiTweenSpeed, function()
|
delay(guiTweenSpeed, function()
|
||||||
game.GuiService:RemoveCenterDialog(backpack)
|
GuiService:RemoveCenterDialog(backpack)
|
||||||
backpack.Visible = false
|
backpack.Visible = false
|
||||||
backpackButton.Selected = false
|
backpackButton.Selected = false
|
||||||
readyForNextEvent = true
|
readyForNextEvent = true
|
||||||
|
|
@ -201,8 +209,8 @@ end
|
||||||
local function toggleBackpack()
|
local function toggleBackpack()
|
||||||
if
|
if
|
||||||
not (
|
not (
|
||||||
game.Players.LocalPlayer
|
Players.LocalPlayer
|
||||||
and game.Players.LocalPlayer.Character
|
and Players.LocalPlayer.Character
|
||||||
and canToggle
|
and canToggle
|
||||||
and readyForNextEvent
|
and readyForNextEvent
|
||||||
)
|
)
|
||||||
|
|
@ -216,7 +224,7 @@ local function toggleBackpack()
|
||||||
|
|
||||||
if backpackIsOpen then
|
if backpackIsOpen then
|
||||||
Hydrate(loadoutBackground) {
|
Hydrate(loadoutBackground) {
|
||||||
Image = "http://banland.xyz/asset?id=97623721",
|
Image = path "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,
|
||||||
|
|
@ -228,9 +236,9 @@ local function toggleBackpack()
|
||||||
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
||||||
loadoutBackground.Visible = false
|
loadoutBackground.Visible = false
|
||||||
backpackButton.Selected = false
|
backpackButton.Selected = false
|
||||||
backpackButton.Image = "http://banland.xyz/asset?id=97617958"
|
backpackButton.Image = path "asset?id=97617958"
|
||||||
Hydrate(loadoutBackground) {
|
Hydrate(loadoutBackground) {
|
||||||
Image = "http://banland.xyz/asset?id=96536002",
|
Image = path "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),
|
||||||
}
|
}
|
||||||
|
|
@ -353,9 +361,9 @@ publicFunction("BackpackReady", backpackReady)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
coreGuiChanged(
|
coreGuiChanged(
|
||||||
Enum.CoreGuiType.Backpack,
|
Enum.CoreGuiType.Backpack,
|
||||||
game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
|
||||||
)
|
)
|
||||||
game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
inventoryButton.MouseButton1Click:connect(newTabClicked)
|
inventoryButton.MouseButton1Click:connect(newTabClicked)
|
||||||
|
|
@ -399,11 +407,11 @@ backpackButton.MouseButton1Click:connect(function()
|
||||||
toggleBackpack()
|
toggleBackpack()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if game.Players.LocalPlayer.Character then
|
if Players.LocalPlayer.Character then
|
||||||
activateBackpack()
|
activateBackpack()
|
||||||
end
|
end
|
||||||
|
|
||||||
game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack)
|
Players.LocalPlayer.CharacterAdded:connect(activateBackpack)
|
||||||
|
|
||||||
-- search functions
|
-- search functions
|
||||||
searchBox.FocusLost:connect(function(enterPressed)
|
searchBox.FocusLost:connect(function(enterPressed)
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,16 @@
|
||||||
-- CoreGui.RobloxGui.CoreScripts/ChatScript
|
-- CoreGui.RobloxGui.CoreScripts/ChatScript
|
||||||
print "[Mercury]: Loaded corescript 97188756"
|
print "[Mercury]: Loaded corescript 97188756"
|
||||||
|
|
||||||
|
local CoreGui = game:GetService "CoreGui"
|
||||||
|
local GuiService = game:GetService "GuiService"
|
||||||
|
local Players = game:GetService "Players"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
|
|
||||||
|
|
||||||
local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA
|
local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA
|
||||||
local New = require("../Modules/New").New
|
local New = require("../Modules/New").New
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
local forceChatGUI = false
|
local forceChatGUI = false
|
||||||
|
|
||||||
|
|
@ -17,21 +23,16 @@ local function WaitForChild(parent: Instance, childName)
|
||||||
return parent[childName]
|
return parent[childName]
|
||||||
end
|
end
|
||||||
|
|
||||||
while not game.Players.LocalPlayer do
|
while not Players.LocalPlayer do
|
||||||
RunService.Heartbeat:wait()
|
RunService.Heartbeat:wait()
|
||||||
end
|
end
|
||||||
|
|
||||||
local Player = game.Players.LocalPlayer
|
local Player = Players.LocalPlayer
|
||||||
while not Player.Character do
|
while not Player.Character do
|
||||||
RunService.Heartbeat:wait()
|
RunService.Heartbeat:wait()
|
||||||
end
|
end
|
||||||
local Camera = workspace.CurrentCamera
|
local Camera = workspace.CurrentCamera
|
||||||
|
|
||||||
-- Services
|
|
||||||
local CoreGui = game:GetService "CoreGui"
|
|
||||||
local Players = game:GetService "Players"
|
|
||||||
local GuiService = game:GetService "GuiService"
|
|
||||||
|
|
||||||
-- Lua Enums
|
-- Lua Enums
|
||||||
local Enums = {}
|
local Enums = {}
|
||||||
local EnumName = {} -- used as unique key for enum name
|
local EnumName = {} -- used as unique key for enum name
|
||||||
|
|
@ -667,7 +668,7 @@ function Chat:CreateGui()
|
||||||
|
|
||||||
New "ImageLabel" {
|
New "ImageLabel" {
|
||||||
Name = "Background",
|
Name = "Background",
|
||||||
Image = "http://banland.xyz/asset?id=97120937", --96551212';
|
Image = path "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,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ local InsertService = game:GetService "InsertService"
|
||||||
local BadgeService = game:GetService "BadgeService"
|
local BadgeService = game:GetService "BadgeService"
|
||||||
local ScriptContext = game:GetService "ScriptContext"
|
local ScriptContext = game:GetService "ScriptContext"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
|
local ScriptInformationProvider =
|
||||||
|
game:GetService "ScriptInformationProvider" :: ScriptInformationProvider
|
||||||
local ChangeHistoryService = game:GetService "ChangeHistoryService"
|
local ChangeHistoryService = game:GetService "ChangeHistoryService"
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
local Players = game:GetService "Players"
|
local Players = game:GetService "Players"
|
||||||
|
|
@ -14,36 +15,25 @@ local Visit = game:GetService "Visit"
|
||||||
-- establish this peer as the Server
|
-- establish this peer as the Server
|
||||||
local NetworkServer = game:GetService "NetworkServer"
|
local NetworkServer = game:GetService "NetworkServer"
|
||||||
|
|
||||||
-- StartGame --
|
|
||||||
|
|
||||||
RunService:Run()
|
RunService:Run()
|
||||||
|
|
||||||
-- REQUIRES: StartGanmeSharedArgs.txt
|
|
||||||
-- REQUIRES: MonitorGameStatus.txt
|
|
||||||
|
|
||||||
local url = _BASE_URL
|
local url = _BASE_URL
|
||||||
|
|
||||||
-----------------------------------"CUSTOM" SHARED CODE----------------------------------
|
-----------------------------------"CUSTOM" SHARED CODE----------------------------------
|
||||||
|
|
||||||
pcall(function()
|
settings().Network.UseInstancePacketCache = true
|
||||||
settings().Network.UseInstancePacketCache = true
|
settings().Network.UsePhysicsPacketCache = true
|
||||||
end)
|
-- pcall(function()
|
||||||
pcall(function()
|
-- settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.FIFO
|
||||||
settings().Network.UsePhysicsPacketCache = true
|
-- end)
|
||||||
end)
|
settings()["Task Scheduler"].PriorityMethod =
|
||||||
--pcall(function() settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.FIFO end)
|
Enum.PriorityMethod.AccumulatedError
|
||||||
pcall(function()
|
|
||||||
settings()["Task Scheduler"].PriorityMethod =
|
|
||||||
Enum.PriorityMethod.AccumulatedError
|
|
||||||
end)
|
|
||||||
|
|
||||||
--settings().Network.PhysicsSend = 1 -- 1==RoundRobin
|
--settings().Network.PhysicsSend = 1 -- 1==RoundRobin
|
||||||
settings().Network.PhysicsSend = Enum.PhysicsSendMethod.ErrorComputation2
|
settings().Network.PhysicsSend = Enum.PhysicsSendMethod.ErrorComputation2
|
||||||
settings().Network.ExperimentalPhysicsEnabled = true
|
settings().Network.ExperimentalPhysicsEnabled = true
|
||||||
settings().Network.WaitingForCharacterLogRate = 100
|
settings().Network.WaitingForCharacterLogRate = 100
|
||||||
pcall(function()
|
settings().Diagnostics:LegacyScriptMode()
|
||||||
settings().Diagnostics:LegacyScriptMode()
|
|
||||||
end)
|
|
||||||
|
|
||||||
-----------------------------------START GAME SHARED SCRIPT------------------------------
|
-----------------------------------START GAME SHARED SCRIPT------------------------------
|
||||||
|
|
||||||
|
|
@ -68,14 +58,14 @@ if url ~= nil then
|
||||||
|
|
||||||
BadgeService:SetIsBadgeLegalUrl ""
|
BadgeService:SetIsBadgeLegalUrl ""
|
||||||
InsertService:SetBaseSetsUrl(
|
InsertService: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:SetCollectionUrl(`{url}/Game/Tools/InsertAsset.ashx?sid=%d`)
|
InsertService: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")
|
||||||
end
|
end
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
|
@ -101,23 +91,13 @@ end
|
||||||
|
|
||||||
-- Now start the connection
|
-- Now start the connection
|
||||||
NetworkServer:Start(_SERVER_PORT)
|
NetworkServer:Start(_SERVER_PORT)
|
||||||
|
|
||||||
Visit:SetPing(_SERVER_PRESENCE_URL, 30)
|
Visit:SetPing(_SERVER_PRESENCE_URL, 30)
|
||||||
|
|
||||||
-- if timeout then
|
|
||||||
-- ScriptContext:SetTimeout(timeout)
|
|
||||||
-- end
|
|
||||||
ScriptContext.ScriptsDisabled = false
|
ScriptContext.ScriptsDisabled = false
|
||||||
|
|
||||||
-- delay(1, function()
|
|
||||||
-- loadfile(`{url}/analytics/GamePerfMonitor.ashx`)(game.JobId, placeId)
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- yimy stuff
|
-- yimy stuff
|
||||||
local reset = ";mc"
|
Players.PlayerAdded:connect(function(player)
|
||||||
game.Players.PlayerAdded:connect(function(player)
|
|
||||||
player.Chatted:connect(function(msg)
|
player.Chatted:connect(function(msg)
|
||||||
if msg == reset and player.Character then
|
if msg == ";mc" and player.Character then
|
||||||
player.Character.Humanoid.Health = 0
|
player.Character.Humanoid.Health = 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,11 @@ local Players = game:GetService "Players"
|
||||||
local Client = game:GetService "NetworkClient"
|
local Client = game:GetService "NetworkClient"
|
||||||
local Visit = game:GetService "Visit"
|
local Visit = game:GetService "Visit"
|
||||||
|
|
||||||
local player, connectionFailed
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
|
local player: Player
|
||||||
|
local connectionFailed: RBXScriptConnection
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
game:SetPlaceId(_PLACE_ID, false)
|
game:SetPlaceId(_PLACE_ID, false)
|
||||||
|
|
@ -41,14 +45,16 @@ print "! Joining game '_PLACE_ID' place _PLACE_ID at _SERVER_ADDRESS"
|
||||||
|
|
||||||
ChangeHistoryService:SetEnabled(false)
|
ChangeHistoryService:SetEnabled(false)
|
||||||
ContentProvider:SetThreadPool(16)
|
ContentProvider:SetThreadPool(16)
|
||||||
InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
|
InsertService:SetBaseSetsUrl(path "game/tools/insertasset?nsets=10&type=base")
|
||||||
InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
|
InsertService:SetUserSetsUrl(
|
||||||
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
|
path "game/tools/insertasset?nsets=20&type=user&userid=%d"
|
||||||
InsertService:SetAssetUrl "http://banland.xyz/asset?id=%d"
|
)
|
||||||
InsertService:SetAssetVersionUrl "http://banland.xyz/asset?assetversionid=%d"
|
InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d")
|
||||||
|
InsertService:SetAssetUrl(path "asset?id=%d")
|
||||||
|
InsertService:SetAssetVersionUrl(path "asset?assetversionid=%d")
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
game:SetCreatorID(_CREATOR_ID, Enum.CreatorType.User)
|
game:SetCreatorId(_CREATOR_ID, Enum.CreatorType.User)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Bubble chat. This is all-encapsulated to allow us to turn it off with a config setting
|
-- Bubble chat. This is all-encapsulated to allow us to turn it off with a config setting
|
||||||
|
|
@ -56,12 +62,6 @@ pcall(function()
|
||||||
Players:SetChatStyle(Enum.ChatStyle.ClassicAndBubble)
|
Players:SetChatStyle(Enum.ChatStyle.ClassicAndBubble)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
pcall(function()
|
|
||||||
if settings().Network.MtuOverride == 0 then
|
|
||||||
settings().Network.MtuOverride = 1400
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- functions ---------------------------------------
|
-- functions ---------------------------------------
|
||||||
local loadingState = 0
|
local loadingState = 0
|
||||||
local function setLoadingMessage(message: string)
|
local function setLoadingMessage(message: string)
|
||||||
|
|
@ -95,16 +95,15 @@ end
|
||||||
|
|
||||||
-- called when the client connection closes
|
-- called when the client connection closes
|
||||||
local function onDisconnection(_, lostConnection)
|
local function onDisconnection(_, lostConnection)
|
||||||
if lostConnection then
|
setMessage(
|
||||||
setMessage "You have lost the connection to the game"
|
lostConnection and "You have lost the connection to the game"
|
||||||
else
|
or "This game has shut down"
|
||||||
setMessage "This game has shut down"
|
)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function requestCharacter(replicator)
|
local function requestCharacter(replicator)
|
||||||
-- prepare code for when the Character appears
|
-- prepare code for when the Character appears
|
||||||
local connection
|
local connection: RBXScriptConnection
|
||||||
connection = player.Changed:connect(function(property)
|
connection = player.Changed:connect(function(property)
|
||||||
if property == "Character" then
|
if property == "Character" then
|
||||||
loadingState += 1
|
loadingState += 1
|
||||||
|
|
@ -127,11 +126,12 @@ local function requestCharacter(replicator)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- called when the client connection is established
|
-- called when the client connection is established
|
||||||
local function onConnectionAccepted(_, replicator)
|
local function onConnectionAccepted(_, rep: Instance)
|
||||||
|
local replicator = rep :: NetworkReplicator
|
||||||
local waitingForMarker = true
|
local waitingForMarker = true
|
||||||
|
|
||||||
local ok, err = pcall(function()
|
local ok, err = pcall(function()
|
||||||
Visit:SetPing(_PING_URL, 30)
|
Visit:SetPing("_PING_URL", 30)
|
||||||
|
|
||||||
loadingState += 1
|
loadingState += 1
|
||||||
game:SetMessageBrickCount()
|
game:SetMessageBrickCount()
|
||||||
|
|
@ -139,7 +139,7 @@ local function onConnectionAccepted(_, replicator)
|
||||||
replicator.Disconnection:connect(onDisconnection)
|
replicator.Disconnection:connect(onDisconnection)
|
||||||
|
|
||||||
-- Wait for a marker to return before creating the Player
|
-- Wait for a marker to return before creating the Player
|
||||||
local marker = replicator:SendMarker()
|
local marker = replicator:SendMarker() :: NetworkMarker
|
||||||
|
|
||||||
marker.Received:connect(function()
|
marker.Received:connect(function()
|
||||||
waitingForMarker = false
|
waitingForMarker = false
|
||||||
|
|
@ -161,8 +161,8 @@ local function onConnectionAccepted(_, replicator)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- called when the client connection fails
|
-- called when the client connection fails
|
||||||
local function onConnectionFailed(_, err)
|
local function onConnectionFailed(_, code: number, reason: string)
|
||||||
setMessage(`Failed to connect to the place. (ID={err})`)
|
setMessage(`Failed to connect to the place. (ID {code}, {reason})`)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- called when the client connection is rejected
|
-- called when the client connection is rejected
|
||||||
|
|
@ -185,9 +185,7 @@ end
|
||||||
|
|
||||||
-- main ------------------------------------------------------------
|
-- main ------------------------------------------------------------
|
||||||
|
|
||||||
pcall(function()
|
settings().Diagnostics:LegacyScriptMode()
|
||||||
settings().Diagnostics:LegacyScriptMode()
|
|
||||||
end)
|
|
||||||
local ok, err = pcall(function()
|
local ok, err = pcall(function()
|
||||||
game:SetRemoteBuildMode(true)
|
game:SetRemoteBuildMode(true)
|
||||||
|
|
||||||
|
|
@ -197,28 +195,19 @@ local ok, err = pcall(function()
|
||||||
connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed)
|
connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed)
|
||||||
Client.Ticket = ""
|
Client.Ticket = ""
|
||||||
|
|
||||||
local playerConnectSuccess
|
player = Client:PlayerConnect(
|
||||||
playerConnectSuccess, player = pcall(function()
|
_USER_ID,
|
||||||
return Client:PlayerConnect(
|
"_SERVER_ADDRESS",
|
||||||
_USER_ID,
|
_SERVER_PORT,
|
||||||
"_SERVER_ADDRESS",
|
0,
|
||||||
_SERVER_PORT,
|
threadSleepTime
|
||||||
0,
|
) :: Player
|
||||||
threadSleepTime
|
|
||||||
)
|
|
||||||
end)
|
|
||||||
if not playerConnectSuccess then
|
|
||||||
-- Old player connection scheme
|
|
||||||
player = Players:CreateLocalPlayer(_USER_ID)
|
|
||||||
Client:Connect("_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime)
|
|
||||||
end
|
|
||||||
|
|
||||||
player:SetSuperSafeChat(false)
|
player:SetSuperSafeChat(false)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
player:SetUnder13(false)
|
player:SetUnder13(false)
|
||||||
end)
|
end)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
player:SetMembershipType(Enum.MembershipType._MEMBERSHIP_TYPE)
|
player:SetMembershipType(_MEMBERSHIP_TYPE)
|
||||||
end)
|
end)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
player:SetAccountAge(1)
|
player:SetAccountAge(1)
|
||||||
|
|
@ -228,7 +217,7 @@ local ok, err = pcall(function()
|
||||||
pcall(function()
|
pcall(function()
|
||||||
player.Name = [========[_USER_NAME]========]
|
player.Name = [========[_USER_NAME]========]
|
||||||
end)
|
end)
|
||||||
player.CharacterAppearance = _CHAR_APPEARANCE
|
player.CharacterAppearance = "_CHAR_APPEARANCE"
|
||||||
Visit:SetUploadUrl ""
|
Visit:SetUploadUrl ""
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
@ -240,6 +229,6 @@ pcall(function()
|
||||||
game:SetScreenshotInfo ""
|
game:SetScreenshotInfo ""
|
||||||
end)
|
end)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[Mercury Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://banland.xyz]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>Mercury, video, free game, online virtual world</media:keywords></media:group></entry>'
|
game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[Mercury Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://banland.xyz]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>Mercury, video, free game, online virtual world</media:keywords></media:group></entry>'
|
||||||
end)
|
end)
|
||||||
-- use single quotes here because the video info string may have unescaped double quotes
|
-- use single quotes here because the video info string may have unescaped double quotes
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
--!strict
|
--!strict
|
||||||
-- Render script for R6 avatars
|
-- Render script for R6 avatars
|
||||||
|
|
||||||
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
local ThumbnailGenerator =
|
||||||
|
game:GetService "ThumbnailGenerator" :: ThumbnailGenerator
|
||||||
local RenderModule = require "../Modules/Render"
|
local RenderModule = require "../Modules/Render"
|
||||||
local SetupAvatar = require "../Modules/Render/SetupAvatar"
|
local SetupAvatar = require "../Modules/Render/SetupAvatar"
|
||||||
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
|
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
|
||||||
|
|
@ -23,7 +24,7 @@ player.Character.Torso["Right Shoulder"].CurrentAngle = 0
|
||||||
-- Headshot Camera
|
-- Headshot Camera
|
||||||
local CameraAngle = player.Character.Head.CFrame
|
local CameraAngle = player.Character.Head.CFrame
|
||||||
local CameraPosition = CameraAngle
|
local CameraPosition = CameraAngle
|
||||||
+ CFrame.Angles(0, math.pi, 0).lookVector.unit * 2.75
|
+ CFrame.Angles(0, math.pi, 0).lookVector.Unit * 2.75
|
||||||
|
|
||||||
workspace.CurrentCamera = New "Camera" {
|
workspace.CurrentCamera = New "Camera" {
|
||||||
Name = "ThumbnailCamera",
|
Name = "ThumbnailCamera",
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,42 @@
|
||||||
print "[Mercury]: Loaded Studio corescript"
|
print "[Mercury]: Loaded Studio corescript"
|
||||||
|
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
|
local ScriptInformationProvider =
|
||||||
|
game:GetService "ScriptInformationProvider" :: ScriptInformationProvider
|
||||||
local ScriptContext = game:GetService "ScriptContext"
|
local ScriptContext = game:GetService "ScriptContext"
|
||||||
|
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
InsertService:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
|
InsertService:SetFreeModelUrl(
|
||||||
|
path "game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
|
||||||
|
)
|
||||||
end)
|
end)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
InsertService:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
|
InsertService:SetFreeDecalUrl(
|
||||||
|
path "game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
|
||||||
|
)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ScriptInformationProvider:SetAssetUrl "http://banland.xyz/asset/"
|
ScriptInformationProvider:SetAssetUrl(path "asset/")
|
||||||
InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
|
InsertService:SetBaseSetsUrl(path "game/tools/insertasset?nsets=10&type=base")
|
||||||
InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
|
InsertService:SetUserSetsUrl(
|
||||||
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
|
path "game/tools/insertasset?nsets=20&type=user&userid=%d"
|
||||||
InsertService:SetAssetUrl "http://banland.xyz/asset?id=%d"
|
)
|
||||||
InsertService:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d"
|
InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d")
|
||||||
|
InsertService:SetAssetUrl(path "asset?id=%d")
|
||||||
|
InsertService:SetAssetVersionUrl(path "asset/?assetversionid=%d")
|
||||||
InsertService:SetTrustLevel(0)
|
InsertService:SetTrustLevel(0)
|
||||||
|
|
||||||
if not pcall(function()
|
if
|
||||||
ScriptContext:AddStarterScript(37801172)
|
not pcall(function()
|
||||||
end) then
|
print "Adding starter script (1)"
|
||||||
|
ScriptContext:AddStarterScript(37801172)
|
||||||
|
end)
|
||||||
|
then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
print "Adding starter script (2)"
|
||||||
ScriptContext:AddCoreScript(37801172, ScriptContext, "StarterScript")
|
ScriptContext:AddCoreScript(37801172, ScriptContext, "StarterScript")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,16 @@ local ChangeHistoryService = game:GetService "ChangeHistoryService"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
local Players = game:GetService "Players"
|
local Players = game:GetService "Players"
|
||||||
local RunService = game:GetService "RunService"
|
local RunService = game:GetService "RunService"
|
||||||
local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
|
local ScriptInformationProvider =
|
||||||
local SocialService = game:GetService "SocialService"
|
game:GetService "ScriptInformationProvider" :: ScriptInformationProvider
|
||||||
|
local SocialService = game:GetService "SocialService" :: SocialService
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
local GamePassService = game:GetService "GamePassService"
|
local GamePassService = game:GetService "GamePassService"
|
||||||
local Visit = game:GetService "Visit"
|
local Visit = game:GetService "Visit"
|
||||||
|
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
local player
|
local player
|
||||||
|
|
||||||
-- Prepended to Edit.lua and Visit.lua and Studio.lua and PlaySolo.lua--
|
-- Prepended to Edit.lua and Visit.lua and Studio.lua and PlaySolo.lua--
|
||||||
|
|
@ -23,43 +27,61 @@ local message = Instance.new "Message"
|
||||||
message.Parent = workspace
|
message.Parent = workspace
|
||||||
message.archivable = false
|
message.archivable = false
|
||||||
|
|
||||||
ScriptInformationProvider:SetAssetUrl "http://banland.xyz/Asset/"
|
ScriptInformationProvider:SetAssetUrl(path "Asset/")
|
||||||
ContentProvider:SetThreadPool(16)
|
ContentProvider:SetThreadPool(16)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
InsertService:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
|
InsertService:SetFreeModelUrl(
|
||||||
|
path "game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
|
||||||
|
)
|
||||||
end) -- Used for free model search (insert tool)
|
end) -- Used for free model search (insert tool)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
InsertService:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
|
InsertService:SetFreeDecalUrl(
|
||||||
|
path "game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
|
||||||
|
)
|
||||||
end) -- Used for free decal search (insert tool)
|
end) -- Used for free decal search (insert tool)
|
||||||
|
|
||||||
settings().Diagnostics:LegacyScriptMode()
|
settings().Diagnostics:LegacyScriptMode()
|
||||||
|
|
||||||
InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
|
InsertService:SetBaseSetsUrl(path "game/tools/insertasset?nsets=10&type=base")
|
||||||
InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
|
InsertService:SetUserSetsUrl(
|
||||||
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
|
path "game/tools/insertasset?nsets=20&type=user&userid=%d"
|
||||||
InsertService:SetAssetUrl "http://banland.xyz/asset?id=%d"
|
)
|
||||||
InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
|
InsertService:SetCollectionUrl(path "game/tools/insertasset?sid=%d")
|
||||||
|
InsertService:SetAssetUrl(path "asset?id=%d")
|
||||||
|
InsertService:SetAssetVersionUrl(path "Asset/?assetversionid=%d")
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
|
SocialService:SetFriendUrl(
|
||||||
|
path "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(
|
||||||
|
path "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(
|
||||||
|
path "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(
|
||||||
|
path "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(
|
||||||
|
path "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(
|
||||||
|
path "Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
|
||||||
|
)
|
||||||
end)
|
end)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
game:SetCreatorID(0, Enum.CreatorType.User)
|
game:SetCreatorId(0, Enum.CreatorType.User)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
|
@ -79,7 +101,9 @@ end)
|
||||||
|
|
||||||
ChangeHistoryService:SetEnabled(false)
|
ChangeHistoryService:SetEnabled(false)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
Players:SetBuildUserPermissionsUrl "http://banland.xyz/Game/BuildActionPermissionCheck.ashx?assetId=0&userId=%d&isSolo=true"
|
Players:SetBuildUserPermissionsUrl(
|
||||||
|
path "Game/BuildActionPermissionCheck.ashx?assetId=0&userId=%d&isSolo=true"
|
||||||
|
)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
workspace:SetPhysicsThrottleEnabled(true)
|
workspace:SetPhysicsThrottleEnabled(true)
|
||||||
|
|
@ -101,7 +125,7 @@ local ok, err = pcall(function()
|
||||||
player.CharacterAppearance = ""
|
player.CharacterAppearance = ""
|
||||||
local propExists, canAutoLoadChar = false, false
|
local propExists, canAutoLoadChar = false, false
|
||||||
propExists = pcall(function()
|
propExists = pcall(function()
|
||||||
canAutoLoadChar = game.Players.CharacterAutoLoads
|
canAutoLoadChar = Players.CharacterAutoLoads
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if (propExists and canAutoLoadChar) or not propExists then
|
if (propExists and canAutoLoadChar) or not propExists then
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,13 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local plugin = PluginManager():CreatePlugin()
|
local plugin = PluginManager():CreatePlugin() :: Plugin
|
||||||
local toolbar = plugin:CreateToolbar "Terrain"
|
local toolbar = plugin:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton =
|
local toolbarbutton = toolbar:CreateButton(
|
||||||
toolbar:CreateButton("Generator", "Terrain Generator", "terrain.png")
|
"Generator",
|
||||||
|
"Terrain Generator",
|
||||||
|
"terrain.png"
|
||||||
|
) :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -51,8 +54,8 @@ function TerrainOptions.Create()
|
||||||
setmetatable(options, TerrainOptions)
|
setmetatable(options, TerrainOptions)
|
||||||
|
|
||||||
-- Offset to create terrain at.
|
-- Offset to create terrain at.
|
||||||
options.xpos = 0
|
options.Xpos = 0
|
||||||
options.zpos = 0
|
options.Zpos = 0
|
||||||
|
|
||||||
-- X width
|
-- X width
|
||||||
options.width = 512
|
options.width = 512
|
||||||
|
|
@ -110,7 +113,7 @@ end
|
||||||
--
|
--
|
||||||
-- Return:
|
-- Return:
|
||||||
-- Value is a new terrain options set with the old terrain options data.
|
-- Value is a new terrain options set with the old terrain options data.
|
||||||
function TerrainOptions:Clone(_)
|
function TerrainOptions:Clone()
|
||||||
return CopyTable(self)
|
return CopyTable(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -236,9 +239,9 @@ function Highlighter.Create(_, ID, color)
|
||||||
highlighter.width = 0
|
highlighter.width = 0
|
||||||
highlighter.length = 0
|
highlighter.length = 0
|
||||||
|
|
||||||
highlighter.x = 0
|
highlighter.X = 0
|
||||||
highlighter.y = 0
|
highlighter.Y = 0
|
||||||
highlighter.z = 0
|
highlighter.Z = 0
|
||||||
|
|
||||||
-- Create the part that the highlighter will be attached to.
|
-- Create the part that the highlighter will be attached to.
|
||||||
highlighter.selectionPart = New "Part" {
|
highlighter.selectionPart = New "Part" {
|
||||||
|
|
@ -282,24 +285,24 @@ function Highlighter:UpdatePosition(cellPos: Vector3)
|
||||||
|
|
||||||
local regionToSelect
|
local regionToSelect
|
||||||
|
|
||||||
self.x = cellPos.x
|
self.X = cellPos.X
|
||||||
self.y = cellPos.y
|
self.Y = cellPos.Y
|
||||||
self.z = cellPos.z
|
self.Z = cellPos.Z
|
||||||
|
|
||||||
local width, length, height =
|
local width, length, height =
|
||||||
self.width :: number, self.length :: number, self.height :: number
|
self.width :: number, self.length :: number, self.height :: number
|
||||||
|
|
||||||
local lowVec = CellCenterToWorld(
|
local lowVec = CellCenterToWorld(
|
||||||
c,
|
c,
|
||||||
cellPos.x - width / 2,
|
cellPos.X - width / 2,
|
||||||
cellPos.y - 1,
|
cellPos.Y - 1,
|
||||||
cellPos.z - length / 2
|
cellPos.Z - length / 2
|
||||||
)
|
)
|
||||||
local highVec = CellCenterToWorld(
|
local highVec = CellCenterToWorld(
|
||||||
c,
|
c,
|
||||||
cellPos.x + width / 2,
|
cellPos.X + width / 2,
|
||||||
cellPos.y + height,
|
cellPos.Y + height,
|
||||||
cellPos.z + length / 2
|
cellPos.Z + length / 2
|
||||||
)
|
)
|
||||||
regionToSelect = Region3.new(lowVec, highVec)
|
regionToSelect = Region3.new(lowVec, highVec)
|
||||||
|
|
||||||
|
|
@ -320,7 +323,7 @@ function Highlighter:UpdateDimensions(
|
||||||
self.length = length
|
self.length = length
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self:UpdatePosition(Vector3.new(self.x, self.y, self.z))
|
self:UpdatePosition(Vector3.new(self.X, self.Y, self.Z))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create a standardized slider.
|
-- Create a standardized slider.
|
||||||
|
|
@ -397,7 +400,7 @@ local function LoadProgressBar(text)
|
||||||
cancelValues.bindForCancel.Event:connect(function(_)
|
cancelValues.bindForCancel.Event:connect(function(_)
|
||||||
cancelValues.cancelActions = true -- Set the flag that everything should stop.
|
cancelValues.cancelActions = true -- Set the flag that everything should stop.
|
||||||
|
|
||||||
coroutine.yield()
|
coroutine.Yield()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -428,13 +431,13 @@ local _, offsetXSliderPosition = CreateStandardSlider(
|
||||||
UDim2.new(0, 10, 0.5, -2),
|
UDim2.new(0, 10, 0.5, -2),
|
||||||
128,
|
128,
|
||||||
function(offsetXSliderPosition2)
|
function(offsetXSliderPosition2)
|
||||||
terrainOptions.xpos = (offsetXSliderPosition2.Value - 1) * 4 - 252
|
terrainOptions.Xpos = (offsetXSliderPosition2.Value - 1) * 4 - 252
|
||||||
offsetXLabel.Text = "X-Offset: " .. terrainOptions.xpos
|
offsetXLabel.Text = "X-Offset: " .. terrainOptions.Xpos
|
||||||
end,
|
end,
|
||||||
nil,
|
nil,
|
||||||
terrainFrame
|
terrainFrame
|
||||||
)
|
)
|
||||||
offsetXSliderPosition.Value = (terrainOptions.xpos + 252) / 4 + 1
|
offsetXSliderPosition.Value = (terrainOptions.Xpos + 252) / 4 + 1
|
||||||
|
|
||||||
-- Slider for controlling the z offset to generate terrain at.
|
-- Slider for controlling the z offset to generate terrain at.
|
||||||
local offsetZLabel = CreateStandardLabel(
|
local offsetZLabel = CreateStandardLabel(
|
||||||
|
|
@ -450,13 +453,13 @@ local _, offsetZSliderPosition = CreateStandardSlider(
|
||||||
UDim2.new(0, 10, 0.5, -2),
|
UDim2.new(0, 10, 0.5, -2),
|
||||||
128,
|
128,
|
||||||
function(offsetZSliderPosition2)
|
function(offsetZSliderPosition2)
|
||||||
terrainOptions.zpos = (offsetZSliderPosition2.Value - 1) * 4 - 252
|
terrainOptions.Zpos = (offsetZSliderPosition2.Value - 1) * 4 - 252
|
||||||
offsetZLabel.Text = "Z-Offset: " .. terrainOptions.zpos
|
offsetZLabel.Text = "Z-Offset: " .. terrainOptions.Zpos
|
||||||
end,
|
end,
|
||||||
nil,
|
nil,
|
||||||
terrainFrame
|
terrainFrame
|
||||||
)
|
)
|
||||||
offsetZSliderPosition.Value = (terrainOptions.zpos + 252) / 4 + 1
|
offsetZSliderPosition.Value = (terrainOptions.Zpos + 252) / 4 + 1
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
--FUNCTION DEFINITIONS-
|
--FUNCTION DEFINITIONS-
|
||||||
|
|
@ -479,7 +482,7 @@ end
|
||||||
-- makes a heightmap for a layer of mountains (width x depth)
|
-- makes a heightmap for a layer of mountains (width x depth)
|
||||||
-- with a width frequency wf and depthfrequency df (width should be divisible by wf, depth should be divisible by df) (for unsquished results, width/wf = depth/df)
|
-- with a width frequency wf and depthfrequency df (width should be divisible by wf, depth should be divisible by df) (for unsquished results, width/wf = depth/df)
|
||||||
-- with a range of amplitudes between 0 and a
|
-- with a range of amplitudes between 0 and a
|
||||||
local function mountLayer(width, depth, wf, df, a)
|
local function mountLayer(width: number, depth: number, wf, df, a: number)
|
||||||
local heightmap = {}
|
local heightmap = {}
|
||||||
for i = 0, width - 1 do
|
for i = 0, width - 1 do
|
||||||
heightmap[i] = {}
|
heightmap[i] = {}
|
||||||
|
|
@ -570,8 +573,14 @@ end
|
||||||
-- Set the camera to look at the terrain from a distance so that all terrain will be in view.
|
-- Set the camera to look at the terrain from a distance so that all terrain will be in view.
|
||||||
-- centerX, centerZ - Center coordinate of land. This doesn't take into account clipping.
|
-- centerX, centerZ - Center coordinate of land. This doesn't take into account clipping.
|
||||||
-- length, width - Land dimensions.
|
-- length, width - Land dimensions.
|
||||||
local function SetCamera(centerX, centerZ, length, width, height)
|
local function SetCamera(
|
||||||
local currCamera = workspace.CurrentCamera
|
centerX: number,
|
||||||
|
centerZ: number,
|
||||||
|
length: number,
|
||||||
|
width: number,
|
||||||
|
height: number
|
||||||
|
)
|
||||||
|
local currCamera = workspace.CurrentCamera :: Camera
|
||||||
local cameraPos = Vector3.new(0, 400, 1600)
|
local cameraPos = Vector3.new(0, 400, 1600)
|
||||||
local cameraFocus = Vector3.new(0, height * 4, 0)
|
local cameraFocus = Vector3.new(0, height * 4, 0)
|
||||||
|
|
||||||
|
|
@ -625,15 +634,15 @@ local function GenerateTerrain()
|
||||||
|
|
||||||
--Generate Terrain
|
--Generate Terrain
|
||||||
-- offset terrain additionally by whatever the smallest cell is
|
-- offset terrain additionally by whatever the smallest cell is
|
||||||
--xpos2 = generateOptions.xpos + workspace.Terrain.MaxExtents.Min.X
|
--xpos2 = generateOptions.Xpos + workspace.Terrain.MaxExtents.Min.X
|
||||||
--zpos2 = generateOptions.zpos + workspace.Terrain.MaxExtents.Min.Z
|
--zpos2 = generateOptions.Zpos + workspace.Terrain.MaxExtents.Min.Z
|
||||||
local xpos2 = generateOptions.xpos - generateOptions.width / 2
|
local xpos2 = generateOptions.Xpos - generateOptions.width / 2
|
||||||
local zpos2 = generateOptions.zpos - generateOptions.length / 2
|
local zpos2 = generateOptions.Zpos - generateOptions.length / 2
|
||||||
|
|
||||||
-- Reposition to get a good view.
|
-- Reposition to get a good view.
|
||||||
SetCamera(
|
SetCamera(
|
||||||
generateOptions.xpos,
|
generateOptions.Xpos,
|
||||||
generateOptions.zpos,
|
generateOptions.Zpos,
|
||||||
generateOptions.length,
|
generateOptions.length,
|
||||||
generateOptions.width,
|
generateOptions.width,
|
||||||
math.max(generateOptions.baseHeight, generateOptions.a / 2)
|
math.max(generateOptions.baseHeight, generateOptions.a / 2)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
while not game do
|
while not game do
|
||||||
wait()
|
wait()
|
||||||
end
|
end
|
||||||
|
|
@ -17,11 +18,11 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local plugin = PluginManager():CreatePlugin()
|
local plugin = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = plugin:GetMouse()
|
local mouse = plugin:GetMouse()
|
||||||
|
|
||||||
local toolbar = plugin:CreateToolbar "Terrain"
|
local toolbar = plugin:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton("Builder", "Builder", "builder.png")
|
local toolbarbutton = toolbar:CreateButton("Builder", "Builder", "builder.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -126,7 +127,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
-- success - Value is true if there was a plane intersection, false if not.
|
-- success - Value is true if there was a plane intersection, false if not.
|
||||||
-- cellPos - Value is the terrain cell intersection point if there is one, vectorPos if there isn't.
|
-- cellPos - Value is the terrain cell intersection point if there is one, vectorPos if there isn't.
|
||||||
function PlaneIntersection(vectorPos)
|
function PlaneIntersection(vectorPos)
|
||||||
local currCamera = workspace.CurrentCamera
|
local currCamera = workspace.CurrentCamera :: Camera
|
||||||
local startPos = Vector3.new(
|
local startPos = Vector3.new(
|
||||||
currCamera.CoordinateFrame.p.X,
|
currCamera.CoordinateFrame.p.X,
|
||||||
currCamera.CoordinateFrame.p.Y,
|
currCamera.CoordinateFrame.p.Y,
|
||||||
|
|
@ -153,7 +154,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
|
|
||||||
-- Update where the highlighter is displayed.
|
-- Update where the highlighter is displayed.
|
||||||
-- position - Where to display the highlighter, in world space.
|
-- position - Where to display the highlighter, in world space.
|
||||||
function UpdatePosition(position)
|
function UpdatePosition(position: Vector3)
|
||||||
if not position then
|
if not position then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -162,7 +163,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
-- Change this gui to be the one you want to use.
|
-- Change this gui to be the one you want to use.
|
||||||
highlighter.selectionBox.Parent = CoreGui
|
highlighter.selectionBox.Parent = CoreGui
|
||||||
|
|
||||||
local vectorPos = Vector3.new(position.x, position.y, position.z)
|
local vectorPos = Vector3.new(position.X, position.Y, position.Z)
|
||||||
local cellPos = WorldToCellPreferEmpty(c, vectorPos)
|
local cellPos = WorldToCellPreferEmpty(c, vectorPos)
|
||||||
local solidCell = WorldToCellPreferSolid(c, vectorPos)
|
local solidCell = WorldToCellPreferSolid(c, vectorPos)
|
||||||
local success = false
|
local success = false
|
||||||
|
|
@ -179,9 +180,9 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
|
|
||||||
local regionToSelect
|
local regionToSelect
|
||||||
|
|
||||||
local lowVec = CellCenterToWorld(c, cellPos.x, cellPos.y - 1, cellPos.z)
|
local lowVec = CellCenterToWorld(c, cellPos.X, cellPos.Y - 1, cellPos.Z)
|
||||||
local highVec =
|
local highVec =
|
||||||
CellCenterToWorld(c, cellPos.x, cellPos.y + 1, cellPos.z)
|
CellCenterToWorld(c, cellPos.X, cellPos.Y + 1, cellPos.Z)
|
||||||
regionToSelect = Region3.new(lowVec, highVec)
|
regionToSelect = Region3.new(lowVec, highVec)
|
||||||
|
|
||||||
highlighter.selectionPart.Size = regionToSelect.Size
|
highlighter.selectionPart.Size = regionToSelect.Size
|
||||||
|
|
@ -192,12 +193,12 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
if nil == highlighter.lastUsedPoint then
|
if nil == highlighter.lastUsedPoint then
|
||||||
highlighter.lastUsedPoint = WorldToCellPreferEmpty(
|
highlighter.lastUsedPoint = WorldToCellPreferEmpty(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
Vector3.new(mouseH.Hit.X, mouseH.Hit.Y, mouseH.Hit.Z)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
cellPos = WorldToCellPreferEmpty(
|
cellPos = WorldToCellPreferEmpty(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
Vector3.new(mouseH.Hit.X, mouseH.Hit.Y, mouseH.Hit.Z)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -286,18 +287,18 @@ local function onClicked()
|
||||||
|
|
||||||
local cellPos = WorldToCellPreferEmpty(
|
local cellPos = WorldToCellPreferEmpty(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
|
Vector3.new(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z)
|
||||||
)
|
)
|
||||||
local x = cellPos.x
|
local x = cellPos.X
|
||||||
local y = cellPos.y
|
local y = cellPos.Y
|
||||||
local z = cellPos.z
|
local z = cellPos.Z
|
||||||
|
|
||||||
local solidCellPos = WorldToCellPreferSolid(
|
local solidCellPos = WorldToCellPreferSolid(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
|
Vector3.new(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z)
|
||||||
)
|
)
|
||||||
|
|
||||||
local celMat = GetCell(c, solidCellPos.x, solidCellPos.y, solidCellPos.z)
|
local celMat = GetCell(c, solidCellPos.X, solidCellPos.Y, solidCellPos.Z)
|
||||||
local success = false
|
local success = false
|
||||||
|
|
||||||
if celMat.Value > 0 then
|
if celMat.Value > 0 then
|
||||||
|
|
@ -312,15 +313,15 @@ local function onClicked()
|
||||||
end
|
end
|
||||||
|
|
||||||
success, cellPos = PlaneIntersection(
|
success, cellPos = PlaneIntersection(
|
||||||
Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
|
Vector3.new(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z)
|
||||||
)
|
)
|
||||||
if not success then
|
if not success then
|
||||||
cellPos = solidCellPos
|
cellPos = solidCellPos
|
||||||
end
|
end
|
||||||
|
|
||||||
x = cellPos.x
|
x = cellPos.X
|
||||||
y = cellPos.y
|
y = cellPos.Y
|
||||||
z = cellPos.z
|
z = cellPos.Z
|
||||||
end
|
end
|
||||||
|
|
||||||
if selectionProps.isWater and 17 == selectionProps.terrainMaterial then
|
if selectionProps.isWater and 17 == selectionProps.terrainMaterial then
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
while not game do
|
while not game do
|
||||||
wait()
|
wait()
|
||||||
end
|
end
|
||||||
|
|
@ -20,12 +21,12 @@ local On, Off
|
||||||
---------------
|
---------------
|
||||||
--PLUGIN SETUP-
|
--PLUGIN SETUP-
|
||||||
---------------
|
---------------
|
||||||
local plugin = PluginManager():CreatePlugin()
|
local plugin = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = plugin:GetMouse()
|
local mouse = plugin:GetMouse()
|
||||||
|
|
||||||
local toolbar = plugin:CreateToolbar "Terrain"
|
local toolbar = plugin:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton =
|
local toolbarbutton =
|
||||||
toolbar:CreateButton("Remover", "Remover", "destroyer.png")
|
toolbar:CreateButton("Remover", "Remover", "destroyer.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -102,14 +103,14 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
-- Change this gui to be the one you want to use.
|
-- Change this gui to be the one you want to use.
|
||||||
highlighter.selectionBox.Parent = CoreGui
|
highlighter.selectionBox.Parent = CoreGui
|
||||||
|
|
||||||
local vectorPos = Vector3.new(position.x, position.y, position.z)
|
local vectorPos = Vector3.new(position.X, position.Y, position.Z)
|
||||||
local cellPos = WorldToCellPreferSolid(c, vectorPos)
|
local cellPos = WorldToCellPreferSolid(c, vectorPos)
|
||||||
|
|
||||||
local regionToSelect
|
local regionToSelect
|
||||||
|
|
||||||
local lowVec = CellCenterToWorld(c, cellPos.x, cellPos.y - 1, cellPos.z)
|
local lowVec = CellCenterToWorld(c, cellPos.X, cellPos.Y - 1, cellPos.Z)
|
||||||
local highVec =
|
local highVec =
|
||||||
CellCenterToWorld(c, cellPos.x, cellPos.y + 1, cellPos.z)
|
CellCenterToWorld(c, cellPos.X, cellPos.Y + 1, cellPos.Z)
|
||||||
regionToSelect = Region3.new(lowVec, highVec)
|
regionToSelect = Region3.new(lowVec, highVec)
|
||||||
|
|
||||||
highlighter.selectionPart.Size = regionToSelect.Size
|
highlighter.selectionPart.Size = regionToSelect.Size
|
||||||
|
|
@ -121,12 +122,12 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
elseif not highlighter.lastUsedPoint then
|
elseif not highlighter.lastUsedPoint then
|
||||||
highlighter.lastUsedPoint = WorldToCellPreferSolid(
|
highlighter.lastUsedPoint = WorldToCellPreferSolid(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouse2.Hit.x, mouse2.Hit.y, mouse2.Hit.z)
|
Vector3.new(mouse2.Hit.X, mouse2.Hit.Y, mouse2.Hit.Z)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
cellPos = WorldToCellPreferSolid(
|
cellPos = WorldToCellPreferSolid(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouse2.Hit.x, mouse2.Hit.y, mouse2.Hit.z)
|
Vector3.new(mouse2.Hit.X, mouse2.Hit.Y, mouse2.Hit.Z)
|
||||||
)
|
)
|
||||||
|
|
||||||
-- holdChange = cellPos - highlighter.lastUsedPoint -- ?
|
-- holdChange = cellPos - highlighter.lastUsedPoint -- ?
|
||||||
|
|
@ -240,11 +241,11 @@ local function onClicked()
|
||||||
end
|
end
|
||||||
local cellPos = WorldToCellPreferSolid(
|
local cellPos = WorldToCellPreferSolid(
|
||||||
c,
|
c,
|
||||||
Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
|
Vector3.new(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z)
|
||||||
)
|
)
|
||||||
local x = cellPos.x
|
local x = cellPos.X
|
||||||
local y = cellPos.y
|
local y = cellPos.Y
|
||||||
local z = cellPos.z
|
local z = cellPos.Z
|
||||||
|
|
||||||
SetCell(c, x, y, z, 0, 0, 0)
|
SetCell(c, x, y, z, 0, 0, 0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,15 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local plugin = PluginManager():CreatePlugin()
|
local plugin = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = plugin:GetMouse()
|
local mouse = plugin:GetMouse()
|
||||||
|
|
||||||
local toolbar = plugin:CreateToolbar "Terrain"
|
local toolbar = plugin:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton(
|
local toolbarbutton = toolbar:CreateButton(
|
||||||
"Elevation Adjuster",
|
"Elevation Adjuster",
|
||||||
"Elevation Adjuster",
|
"Elevation Adjuster",
|
||||||
"elevation.png"
|
"elevation.png"
|
||||||
)
|
) :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -121,7 +121,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
|
|
||||||
-- Update where the highlighter is displayed.
|
-- Update where the highlighter is displayed.
|
||||||
-- position - Where to display the highlighter, in world space.
|
-- position - Where to display the highlighter, in world space.
|
||||||
local function UpdatePosition(position)
|
local function UpdatePosition(position: Vector3)
|
||||||
if not position then
|
if not position then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -130,7 +130,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
-- Change this gui to be the one you want to use.
|
-- Change this gui to be the one you want to use.
|
||||||
highlighter.selectionBox.Parent = CoreGui
|
highlighter.selectionBox.Parent = CoreGui
|
||||||
|
|
||||||
local vectorPos = Vector3.new(position.x, position.y, position.z)
|
local vectorPos = Vector3.new(position.X, position.Y, position.Z)
|
||||||
local cellPos = WorldToCellPreferEmpty(c, vectorPos)
|
local cellPos = WorldToCellPreferEmpty(c, vectorPos)
|
||||||
local solidCell = WorldToCellPreferSolid(c, vectorPos)
|
local solidCell = WorldToCellPreferSolid(c, vectorPos)
|
||||||
local success = false
|
local success = false
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,11 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
|
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton("Brush", "Brush", "brush.png")
|
local toolbarbutton =
|
||||||
|
toolbar:CreateButton("Brush", "Brush", "brush.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -292,9 +293,9 @@ function doFillCells(position, mouseDrag, needsCellPos)
|
||||||
local timeBetweenFills = tick() - lastCellFillTime
|
local timeBetweenFills = tick() - lastCellFillTime
|
||||||
local totalDragPixels = math.abs(mouseDrag.x) + math.abs(mouseDrag.y)
|
local totalDragPixels = math.abs(mouseDrag.x) + math.abs(mouseDrag.y)
|
||||||
local editDistance = (
|
local editDistance = (
|
||||||
workspace.CurrentCamera.CoordinateFrame.p
|
(workspace.CurrentCamera :: Camera).CoordinateFrame.p
|
||||||
- Vector3.new(position.x, position.y, position.z)
|
- Vector3.new(position.x, position.y, position.z)
|
||||||
).magnitude
|
).Magnitude
|
||||||
|
|
||||||
if timeBetweenFills <= 0.05 then
|
if timeBetweenFills <= 0.05 then
|
||||||
if editDistance * totalDragPixels < 450 then
|
if editDistance * totalDragPixels < 450 then
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = this:GetMouse()
|
local mouse = this:GetMouse()
|
||||||
|
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton("Crater", "Crater", "craters.png")
|
local toolbarbutton = toolbar:CreateButton("Crater", "Crater", "craters.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = this:GetMouse()
|
local mouse = this:GetMouse()
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton("Roads", "Roads", "roads.png")
|
local toolbarbutton = toolbar:CreateButton("Roads", "Roads", "roads.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
while not game do
|
while not game do
|
||||||
wait()
|
wait()
|
||||||
end
|
end
|
||||||
|
|
@ -18,7 +19,7 @@ local on = false
|
||||||
local On, Off
|
local On, Off
|
||||||
local mouseDown, mouseUp, mouseMove
|
local mouseDown, mouseUp, mouseMove
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = this:GetMouse()
|
local mouse = this:GetMouse()
|
||||||
mouse.Button1Down:connect(function()
|
mouse.Button1Down:connect(function()
|
||||||
mouseDown(mouse)
|
mouseDown(mouse)
|
||||||
|
|
@ -30,12 +31,12 @@ mouse.Move:connect(function()
|
||||||
mouseMove(mouse)
|
mouseMove(mouse)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton(
|
local toolbarbutton = toolbar:CreateButton(
|
||||||
"Material Brush",
|
"Material Brush",
|
||||||
"Material Brush",
|
"Material Brush",
|
||||||
"materialBrush.png"
|
"materialBrush.png"
|
||||||
)
|
) :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -50,13 +51,13 @@ workspace:WaitForChild "Terrain"
|
||||||
-----------------------------
|
-----------------------------
|
||||||
--LOCAL FUNCTION DEFINITIONS-
|
--LOCAL FUNCTION DEFINITIONS-
|
||||||
-----------------------------
|
-----------------------------
|
||||||
local c = workspace.Terrain
|
local Terrain = workspace.Terrain
|
||||||
local SetCell = c.SetCell
|
local SetCell = Terrain.SetCell
|
||||||
local SetWaterCell = c.SetWaterCell
|
local SetWaterCell = Terrain.SetWaterCell
|
||||||
-- local GetWaterCell = c.GetWaterCell
|
-- local GetWaterCell = c.GetWaterCell
|
||||||
local GetCell = c.GetCell
|
local GetCell = Terrain.GetCell
|
||||||
local WorldToCellPreferSolid = c.WorldToCellPreferSolid
|
local WorldToCellPreferSolid = Terrain.WorldToCellPreferSolid
|
||||||
local CellCenterToWorld = c.CellCenterToWorld
|
local CellCenterToWorld = Terrain.CellCenterToWorld
|
||||||
local waterMaterial = 17
|
local waterMaterial = 17
|
||||||
|
|
||||||
local brushTypes = { "Circular", "Square" }
|
local brushTypes = { "Circular", "Square" }
|
||||||
|
|
@ -92,7 +93,7 @@ function paintWaterfall(setCells)
|
||||||
end
|
end
|
||||||
for i = 1, #setCells do
|
for i = 1, #setCells do
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -106,7 +107,7 @@ end
|
||||||
|
|
||||||
local function getSquareCell(x: number, y: number, z: number)
|
local function getSquareCell(x: number, y: number, z: number)
|
||||||
-- local tempCellPos = Vector3.new(x, y, z)
|
-- local tempCellPos = Vector3.new(x, y, z)
|
||||||
local oldMaterial, oldType, oldOrientation = GetCell(c, x, y, z)
|
local oldMaterial, oldType, oldOrientation = GetCell(Terrain, x, y, z)
|
||||||
if oldMaterial.Value <= 0 then
|
if oldMaterial.Value <= 0 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
@ -119,15 +120,15 @@ local function getSquareCell(x: number, y: number, z: number)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getSquare(cellPos)
|
local function getSquare(cellPos: Vector3)
|
||||||
local setCells = {}
|
local setCells = {}
|
||||||
local finalX = cellPos.x + radius - 1
|
local finalX = cellPos.X + radius - 1
|
||||||
local finalZ = cellPos.z + radius - 1
|
local finalY = cellPos.Y + radius - 1
|
||||||
local finalY = cellPos.y + radius - 1
|
local finalZ = cellPos.Z + radius - 1
|
||||||
|
|
||||||
for x = cellPos.x - radius + 1, finalX do
|
for x = cellPos.X - radius + 1, finalX do
|
||||||
for z = cellPos.z - radius + 1, finalZ do
|
for y = cellPos.Y - radius + 1, finalY do
|
||||||
for y = cellPos.y - radius + 1, finalY do
|
for z = cellPos.Z - radius + 1, finalZ do
|
||||||
table.insert(setCells, getSquareCell(x, y, z))
|
table.insert(setCells, getSquareCell(x, y, z))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -149,7 +150,7 @@ local function getCircularCell(
|
||||||
if distSq >= radiusSquared then
|
if distSq >= radiusSquared then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local oldMaterial, oldType, oldOrientation = GetCell(c, x, y, z)
|
local oldMaterial, oldType, oldOrientation = GetCell(Terrain, x, y, z)
|
||||||
if oldMaterial.Value <= 0 then
|
if oldMaterial.Value <= 0 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
@ -162,15 +163,16 @@ local function getCircularCell(
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getCircular(cellPos)
|
local function getCircular(cellPos: Vector3)
|
||||||
local setCells = {}
|
local setCells = {}
|
||||||
local finalX = cellPos.x + radius
|
-- whoever originally wrote these ordered (X, Z, Y) is a psychopath - Heliodex
|
||||||
local finalZ = cellPos.z + radius
|
local finalX = cellPos.X + radius
|
||||||
local finalY = cellPos.y + radius
|
local finalY = cellPos.Y + radius
|
||||||
|
local finalZ = cellPos.Z + radius
|
||||||
|
|
||||||
for x = cellPos.x - radius, finalX do
|
for x = cellPos.X - radius, finalX do
|
||||||
for z = cellPos.z - radius, finalZ do
|
for y = cellPos.Y - radius, finalY do
|
||||||
for y = cellPos.y - radius, finalY do
|
for z = cellPos.Z - radius, finalZ do
|
||||||
table.insert(
|
table.insert(
|
||||||
setCells,
|
setCells,
|
||||||
getCircularCell(x, y, z, cellPos, radius * radius)
|
getCircularCell(x, y, z, cellPos, radius * radius)
|
||||||
|
|
@ -182,8 +184,8 @@ local function getCircular(cellPos)
|
||||||
return setCells
|
return setCells
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getAffectedCells(startPos)
|
local function getAffectedCells(startPos: Vector3)
|
||||||
if startPos and c then
|
if startPos and Terrain then
|
||||||
if brushType == "Circular" then
|
if brushType == "Circular" then
|
||||||
return getCircular(startPos)
|
return getCircular(startPos)
|
||||||
elseif brushType == "Square" then
|
elseif brushType == "Square" then
|
||||||
|
|
@ -194,13 +196,13 @@ local function getAffectedCells(startPos)
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function directionIsDown(fromCell, toCell)
|
local function directionIsDown(fromCell: Vector3, toCell: Vector3)
|
||||||
if not toCell then
|
if not toCell then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if toCell and fromCell then
|
if toCell and fromCell then
|
||||||
local direction = (toCell - fromCell).unit
|
local direction = (toCell - fromCell).Unit
|
||||||
local absX, absY, absZ =
|
local absX, absY, absZ =
|
||||||
math.abs(direction.X), math.abs(direction.Y), math.abs(direction.Z)
|
math.abs(direction.X), math.abs(direction.Y), math.abs(direction.Z)
|
||||||
if absY > absX and absY > absZ then
|
if absY > absX and absY > absZ then
|
||||||
|
|
@ -294,7 +296,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
then
|
then
|
||||||
if overallDirection.x > 0 then
|
if overallDirection.x > 0 then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -303,7 +305,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -317,7 +319,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
then
|
then
|
||||||
if overallDirection.z > 0 then
|
if overallDirection.z > 0 then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -326,7 +328,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -340,7 +342,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
then
|
then
|
||||||
if overallDirection.y > 0 then
|
if overallDirection.y > 0 then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -349,7 +351,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[1].xPos,
|
setCells[1].xPos,
|
||||||
setCells[1].yPos,
|
setCells[1].yPos,
|
||||||
setCells[1].zPos,
|
setCells[1].zPos,
|
||||||
|
|
@ -364,7 +366,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
for i = 1, #setCells do
|
for i = 1, #setCells do
|
||||||
if setCells[i].xPos == initX then
|
if setCells[i].xPos == initX then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -373,7 +375,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
elseif setCells[i].xPos == endX then
|
elseif setCells[i].xPos == endX then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -383,7 +385,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
else
|
else
|
||||||
if setCells[i].zPos < zMiddle then
|
if setCells[i].zPos < zMiddle then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -392,7 +394,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
elseif setCells[i].zPos > zMiddle then
|
elseif setCells[i].zPos > zMiddle then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -402,7 +404,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
else
|
else
|
||||||
if setCells[i].xPos < xMiddle then
|
if setCells[i].xPos < xMiddle then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -411,7 +413,7 @@ local function setWaterDirection(mouseCellPos, setCells)
|
||||||
)
|
)
|
||||||
elseif setCells[i].xPos > xMiddle then
|
elseif setCells[i].xPos > xMiddle then
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -439,7 +441,7 @@ local function paintWith(
|
||||||
end
|
end
|
||||||
for i = 1, #setCells do
|
for i = 1, #setCells do
|
||||||
SetCell(
|
SetCell(
|
||||||
c,
|
Terrain,
|
||||||
setCells[i].xPos,
|
setCells[i].xPos,
|
||||||
setCells[i].yPos,
|
setCells[i].yPos,
|
||||||
setCells[i].zPos,
|
setCells[i].zPos,
|
||||||
|
|
@ -453,7 +455,7 @@ local function paintWith(
|
||||||
end
|
end
|
||||||
|
|
||||||
local function paint(startPos)
|
local function paint(startPos)
|
||||||
if not (startPos and c) then
|
if not (startPos and Terrain) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -474,14 +476,14 @@ local function paint(startPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function calculateRegion(mouseR)
|
local function calculateRegion(mouseR)
|
||||||
local cellPos = WorldToCellPreferSolid(c, mouseR.Hit.p)
|
local cellPos = WorldToCellPreferSolid(Terrain, mouseR.Hit.p)
|
||||||
|
|
||||||
local lowVec =
|
local lowVec =
|
||||||
Vector3.new(cellPos.x - radius, cellPos.y - radius, cellPos.z - radius)
|
Vector3.new(cellPos.x - radius, cellPos.y - radius, cellPos.z - radius)
|
||||||
local highVec =
|
local highVec =
|
||||||
Vector3.new(cellPos.x + radius, cellPos.y + radius, cellPos.z + radius)
|
Vector3.new(cellPos.x + radius, cellPos.y + radius, cellPos.z + radius)
|
||||||
lowVec = CellCenterToWorld(c, lowVec.x, lowVec.y, lowVec.z)
|
lowVec = CellCenterToWorld(Terrain, lowVec.x, lowVec.y, lowVec.z)
|
||||||
highVec = CellCenterToWorld(c, highVec.x, highVec.y, highVec.z)
|
highVec = CellCenterToWorld(Terrain, highVec.x, highVec.y, highVec.z)
|
||||||
|
|
||||||
return Region3.new(
|
return Region3.new(
|
||||||
lowVec + Vector3.new(2, 2, 2),
|
lowVec + Vector3.new(2, 2, 2),
|
||||||
|
|
@ -494,7 +496,7 @@ local function createSelection(mouseS, massSelection)
|
||||||
calculateRegion(mouseS),
|
calculateRegion(mouseS),
|
||||||
BrickColor.new "Lime green",
|
BrickColor.new "Lime green",
|
||||||
massSelection,
|
massSelection,
|
||||||
game.CoreGui
|
CoreGui
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -517,7 +519,7 @@ local function setPositionDirectionality()
|
||||||
else
|
else
|
||||||
for i = 1, #cellsToSet do
|
for i = 1, #cellsToSet do
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
cellsToSet[i].xPos,
|
cellsToSet[i].xPos,
|
||||||
cellsToSet[i].yPos,
|
cellsToSet[i].yPos,
|
||||||
cellsToSet[i].zPos,
|
cellsToSet[i].zPos,
|
||||||
|
|
@ -561,7 +563,7 @@ local function setPositionDirectionality()
|
||||||
|
|
||||||
for i = 1, #cellsToSet do
|
for i = 1, #cellsToSet do
|
||||||
SetWaterCell(
|
SetWaterCell(
|
||||||
c,
|
Terrain,
|
||||||
cellsToSet[i].xPos,
|
cellsToSet[i].xPos,
|
||||||
cellsToSet[i].yPos,
|
cellsToSet[i].yPos,
|
||||||
cellsToSet[i].zPos,
|
cellsToSet[i].zPos,
|
||||||
|
|
@ -581,7 +583,7 @@ function mouseDown(mouseD)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local newCell = WorldToCellPreferSolid(c, mouseD.Hit.p)
|
local newCell = WorldToCellPreferSolid(Terrain, mouseD.Hit.p)
|
||||||
if not newCell then
|
if not newCell then
|
||||||
return
|
return
|
||||||
elseif
|
elseif
|
||||||
|
|
@ -607,7 +609,12 @@ function mouseUp(_)
|
||||||
lastCell = nil
|
lastCell = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function moveTowardsGoal(direction: string, currPos, goalPos, currCell)
|
local function moveTowardsGoal(
|
||||||
|
direction: string,
|
||||||
|
currPos: number,
|
||||||
|
goalPos: number,
|
||||||
|
currCell: Vector3
|
||||||
|
)
|
||||||
if currPos == goalPos then
|
if currPos == goalPos then
|
||||||
return currCell
|
return currCell
|
||||||
end
|
end
|
||||||
|
|
@ -670,18 +677,18 @@ function mouseMove(mouseM)
|
||||||
if not on then
|
if not on then
|
||||||
return
|
return
|
||||||
elseif mouseM.Target == workspace.Terrain then
|
elseif mouseM.Target == workspace.Terrain then
|
||||||
if lastCell == WorldToCellPreferSolid(c, mouseM.Hit.p) then
|
if lastCell == WorldToCellPreferSolid(Terrain, mouseM.Hit.p) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
updateSelection(mouseM)
|
updateSelection(mouseM)
|
||||||
local newCell = WorldToCellPreferSolid(c, mouseM.Hit.p)
|
local newCell = WorldToCellPreferSolid(Terrain, mouseM.Hit.p)
|
||||||
|
|
||||||
if not dragging then
|
if not dragging then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- local painting = true
|
-- local painting = true
|
||||||
paint(newCell)
|
paint(newCell)
|
||||||
if lastCell and newCell and (lastCell - newCell).magnitude > 1 then
|
if lastCell and newCell and (lastCell - newCell).Magnitude > 1 then
|
||||||
paintBetweenPoints(lastCell, newCell)
|
paintBetweenPoints(lastCell, newCell)
|
||||||
end
|
end
|
||||||
lastLastCell = lastCell
|
lastLastCell = lastCell
|
||||||
|
|
@ -693,7 +700,7 @@ function mouseMove(mouseM)
|
||||||
end
|
end
|
||||||
|
|
||||||
function On()
|
function On()
|
||||||
if not c then
|
if not Terrain then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
this:Activate(true)
|
this:Activate(true)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
while not game do
|
while not game do
|
||||||
wait()
|
wait()
|
||||||
end
|
end
|
||||||
|
|
@ -16,17 +17,17 @@ local on = false
|
||||||
|
|
||||||
local On, Off
|
local On, Off
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
this.Deactivation:connect(function()
|
this.Deactivation:connect(function()
|
||||||
Off()
|
Off()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton = toolbar:CreateButton(
|
local toolbarbutton = toolbar:CreateButton(
|
||||||
"Stamper",
|
"Stamper",
|
||||||
"Part Stamper - Toggle List (Shift + F)",
|
"Part Stamper - Toggle List (Shift + F)",
|
||||||
"stamp.png"
|
"stamp.png"
|
||||||
)
|
) :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
--!strict
|
||||||
while not game do
|
while not game do
|
||||||
wait()
|
wait()
|
||||||
end
|
end
|
||||||
|
|
@ -11,6 +12,8 @@ local CreateStandardLabel = require "../Modules/Terrain/CreateStandardLabel"
|
||||||
local News = require "../Modules/New"
|
local News = require "../Modules/New"
|
||||||
local New = News.New
|
local New = News.New
|
||||||
local Hydrate = News.Hydrate
|
local Hydrate = News.Hydrate
|
||||||
|
local BaseUrl = require "../Modules/BaseUrl"
|
||||||
|
local path = BaseUrl.path
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
--PLUGIN SETUP-
|
--PLUGIN SETUP-
|
||||||
|
|
@ -21,7 +24,7 @@ local on = false
|
||||||
local On, Off
|
local On, Off
|
||||||
local mouseDown, mouseUp
|
local mouseDown, mouseUp
|
||||||
|
|
||||||
local this = PluginManager():CreatePlugin()
|
local this = PluginManager():CreatePlugin() :: Plugin
|
||||||
local mouse = this:GetMouse()
|
local mouse = this:GetMouse()
|
||||||
mouse.Button1Down:connect(function()
|
mouse.Button1Down:connect(function()
|
||||||
mouseDown(mouse)
|
mouseDown(mouse)
|
||||||
|
|
@ -30,9 +33,9 @@ mouse.Button1Up:connect(function()
|
||||||
mouseUp(mouse)
|
mouseUp(mouse)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local toolbar = this:CreateToolbar "Terrain"
|
local toolbar = this:CreateToolbar "Terrain" :: Toolbar
|
||||||
local toolbarbutton =
|
local toolbarbutton =
|
||||||
toolbar:CreateButton("Flood Fill", "Flood Fill", "floodFill.png")
|
toolbar:CreateButton("Flood Fill", "Flood Fill", "floodFill.png") :: Button
|
||||||
toolbarbutton.Click:connect(function()
|
toolbarbutton.Click:connect(function()
|
||||||
if on then
|
if on then
|
||||||
Off()
|
Off()
|
||||||
|
|
@ -47,12 +50,12 @@ workspace:WaitForChild "Terrain"
|
||||||
-----------------------------
|
-----------------------------
|
||||||
--LOCAL FUNCTION DEFINITIONS-
|
--LOCAL FUNCTION DEFINITIONS-
|
||||||
-----------------------------
|
-----------------------------
|
||||||
local c = workspace.Terrain
|
local Terrain = workspace.Terrain
|
||||||
-- local WorldToCellPreferSolid = c.WorldToCellPreferSolid
|
-- local WorldToCellPreferSolid = c.WorldToCellPreferSolid
|
||||||
local WorldToCellPreferEmpty = c.WorldToCellPreferEmpty
|
local WorldToCellPreferEmpty = Terrain.WorldToCellPreferEmpty
|
||||||
local CellCenterToWorld = c.CellCenterToWorld
|
local CellCenterToWorld = Terrain.CellCenterToWorld
|
||||||
local GetCell = c.GetCell
|
local GetCell = Terrain.GetCell
|
||||||
local SetCell = c.SetCell
|
local SetCell = Terrain.SetCell
|
||||||
-- local maxYExtents = c.MaxExtents.Max.Y
|
-- local maxYExtents = c.MaxExtents.Max.Y
|
||||||
|
|
||||||
local emptyMaterial = Enum.CellMaterial.Empty
|
local emptyMaterial = Enum.CellMaterial.Empty
|
||||||
|
|
@ -78,7 +81,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(path "asset?id=82741829")
|
||||||
|
|
||||||
------------------------- OBJECT DEFINITIONS ---------------------
|
------------------------- OBJECT DEFINITIONS ---------------------
|
||||||
|
|
||||||
|
|
@ -168,7 +171,7 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Size = UDim2.new(1, 0, 1, 0),
|
Size = UDim2.new(1, 0, 1, 0),
|
||||||
Position = UDim2.new(-0.35, 0, -0.5, 0),
|
Position = UDim2.new(-0.35, 0, -0.5, 0),
|
||||||
Image = "http://banland.xyz/asset?id=82741829",
|
Image = path "asset?id=82741829",
|
||||||
Parent = billboardGui,
|
Parent = billboardGui,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,47 +248,48 @@ function MouseHighlighter.Create(mouseUse)
|
||||||
end
|
end
|
||||||
|
|
||||||
local vectorPos = Vector3.new(position.x, position.y, position.z)
|
local vectorPos = Vector3.new(position.x, position.y, position.z)
|
||||||
local cellPos = WorldToCellPreferEmpty(c, vectorPos)
|
local cellPos = WorldToCellPreferEmpty(Terrain, vectorPos)
|
||||||
|
|
||||||
local regionToSelect
|
local regionToSelect
|
||||||
|
|
||||||
local cellMaterial = GetCell(c, cellPos.x, cellPos.y, cellPos.z)
|
local cellMaterial = GetCell(Terrain, cellPos.x, cellPos.y, cellPos.z)
|
||||||
local y = cellPos.y
|
local y = cellPos.y
|
||||||
-- only select empty cells
|
-- only select empty cells
|
||||||
while cellMaterial ~= emptyMaterial do
|
while cellMaterial ~= emptyMaterial do
|
||||||
y = y + 1
|
y += 1
|
||||||
cellMaterial = GetCell(c, cellPos.x, y, cellPos.z)
|
cellMaterial = GetCell(Terrain, cellPos.x, y, cellPos.z)
|
||||||
end
|
end
|
||||||
cellPos = Vector3.new(cellPos.x, y, cellPos.z)
|
cellPos = Vector3.new(cellPos.x, y, cellPos.z)
|
||||||
|
|
||||||
local lowVec = CellCenterToWorld(c, cellPos.x, cellPos.y - 1, cellPos.z)
|
local lowVec =
|
||||||
|
CellCenterToWorld(Terrain, cellPos.x, cellPos.y - 1, cellPos.z)
|
||||||
local highVec =
|
local highVec =
|
||||||
CellCenterToWorld(c, cellPos.x, cellPos.y + 1, cellPos.z)
|
CellCenterToWorld(Terrain, cellPos.x, cellPos.y + 1, cellPos.z)
|
||||||
regionToSelect = Region3.new(lowVec, highVec)
|
regionToSelect = Region3.new(lowVec, highVec)
|
||||||
|
|
||||||
highlighter.selectionPart.CFrame = regionToSelect.CFrame
|
highlighter.selectionPart.CFrame = regionToSelect.CFrame
|
||||||
|
|
||||||
if nil ~= highlighter.OnClicked and highlighter.mouseDown then
|
if not (highlighter.OnClicked and highlighter.mouseDown) then
|
||||||
if nil == highlighter.lastUsedPoint then
|
return
|
||||||
highlighter.lastUsedPoint = WorldToCellPreferEmpty(
|
end
|
||||||
c,
|
if nil == highlighter.lastUsedPoint then
|
||||||
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
highlighter.lastUsedPoint = WorldToCellPreferEmpty(
|
||||||
)
|
Terrain,
|
||||||
else
|
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
||||||
cellPos = WorldToCellPreferEmpty(
|
)
|
||||||
c,
|
else
|
||||||
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
cellPos = WorldToCellPreferEmpty(
|
||||||
)
|
Terrain,
|
||||||
|
Vector3.new(mouseH.Hit.x, mouseH.Hit.y, mouseH.Hit.z)
|
||||||
|
)
|
||||||
|
|
||||||
-- holdChange = cellPos - highlighter.lastUsedPoint
|
-- holdChange = cellPos - highlighter.lastUsedPoint
|
||||||
|
|
||||||
-- Require terrain.
|
-- Require terrain.
|
||||||
if 0 == GetCell(c, cellPos.X, cellPos.Y, cellPos.Z).Value then
|
if 0 == GetCell(Terrain, cellPos.X, cellPos.Y, cellPos.Z).Value then
|
||||||
return
|
return
|
||||||
else
|
|
||||||
highlighter.lastUsedPoint = cellPos
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
highlighter.lastUsedPoint = cellPos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -305,8 +309,7 @@ function MouseHighlighter:SetMaterial(newMaterial)
|
||||||
end
|
end
|
||||||
|
|
||||||
function MouseHighlighter:GetPosition()
|
function MouseHighlighter:GetPosition()
|
||||||
local position = self.selectionPart.CFrame.p
|
return WorldToCellPreferEmpty(Terrain, self.selectionPart.CFrame.p)
|
||||||
return WorldToCellPreferEmpty(c, position)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Hide the highlighter.
|
-- Hide the highlighter.
|
||||||
|
|
@ -421,19 +424,16 @@ end
|
||||||
|
|
||||||
-- Clear the popup, free up assets.
|
-- Clear the popup, free up assets.
|
||||||
function ConfirmationPopup:Clear()
|
function ConfirmationPopup:Clear()
|
||||||
if nil ~= self.confirmButton then
|
if self.confirmButton then
|
||||||
self.confirmButton.Parent = nil
|
self.confirmButton.Parent = nil
|
||||||
end
|
end
|
||||||
|
if self.declineButton then
|
||||||
if nil ~= self.declineButton then
|
|
||||||
self.declineButton.Parent = nil
|
self.declineButton.Parent = nil
|
||||||
end
|
end
|
||||||
|
if self.confirmationFrame then
|
||||||
if nil ~= self.confirmationFrame then
|
|
||||||
self.confirmationFrame.Parent = nil
|
self.confirmationFrame.Parent = nil
|
||||||
end
|
end
|
||||||
|
if self.confirmLabel then
|
||||||
if nil ~= self.confirmLabel then
|
|
||||||
self.confirmLabel.Parent = nil
|
self.confirmLabel.Parent = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -499,7 +499,7 @@ local function LoadProgressBar(text)
|
||||||
-8
|
-8
|
||||||
),
|
),
|
||||||
BackgroundTransparency = 1,
|
BackgroundTransparency = 1,
|
||||||
Image = "http://banland.xyz/asset?id=45880710",
|
Image = path "asset?id=45880710",
|
||||||
Parent = spinnerFrame,
|
Parent = spinnerFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -514,15 +514,13 @@ local function LoadProgressBar(text)
|
||||||
local pos = 0
|
local pos = 0
|
||||||
|
|
||||||
while pos < 8 do
|
while pos < 8 do
|
||||||
if pos == spinPos or pos == ((spinPos + 1) % 8) then
|
spinnerIcons[pos + 1].Image = (
|
||||||
spinnerIcons[pos + 1].Image =
|
pos == spinPos or pos == ((spinPos + 1) % 8)
|
||||||
"http://banland.xyz/asset?id=45880668"
|
)
|
||||||
else
|
and path "asset?id=45880668"
|
||||||
spinnerIcons[pos + 1].Image =
|
or path "asset?id=45880710"
|
||||||
"http://banland.xyz/asset?id=45880710"
|
|
||||||
end
|
|
||||||
|
|
||||||
pos = pos + 1
|
pos += 1
|
||||||
end
|
end
|
||||||
spinPos = (spinPos + 1) % 8
|
spinPos = (spinPos + 1) % 8
|
||||||
wait(0.2)
|
wait(0.2)
|
||||||
|
|
@ -603,8 +601,7 @@ function mouseUp(_)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getMaterial(x, y, z)
|
local function getMaterial(x, y, z)
|
||||||
local material = GetCell(c, x, y, z)
|
return GetCell(Terrain, x, y, z)
|
||||||
return material
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function doBreadthFill(x, y, z)
|
local function doBreadthFill(x, y, z)
|
||||||
|
|
@ -680,15 +677,15 @@ function breadthFill(x, y, z)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function cellInTerrain(x, y, z)
|
local function cellInTerrain(x, y, z)
|
||||||
if x < c.MaxExtents.Min.X or x >= c.MaxExtents.Max.X then
|
if x < Terrain.MaxExtents.Min.X or x >= Terrain.MaxExtents.Max.X then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if y < c.MaxExtents.Min.Y or y >= c.MaxExtents.Max.Y then
|
if y < Terrain.MaxExtents.Min.Y or y >= Terrain.MaxExtents.Max.Y then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if z < c.MaxExtents.Min.Z or z >= c.MaxExtents.Max.Z then
|
if z < Terrain.MaxExtents.Min.Z or z >= Terrain.MaxExtents.Max.Z then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -698,7 +695,7 @@ end
|
||||||
function breadthFillHelper(x, y, z, yDepthChecks)
|
function breadthFillHelper(x, y, z, yDepthChecks)
|
||||||
-- first, lets try and fill this cell
|
-- first, lets try and fill this cell
|
||||||
if cellInTerrain(x, y, z) and getMaterial(x, y, z) == emptyMaterial then
|
if cellInTerrain(x, y, z) and getMaterial(x, y, z) == emptyMaterial then
|
||||||
SetCell(c, x, y, z, currentMaterial, 0, 0)
|
SetCell(Terrain, x, y, z, currentMaterial, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
local cellsToFill = {}
|
local cellsToFill = {}
|
||||||
|
|
@ -735,7 +732,7 @@ function breadthFillHelper(x, y, z, yDepthChecks)
|
||||||
|
|
||||||
for i = 1, #cellsToFill do
|
for i = 1, #cellsToFill do
|
||||||
SetCell(
|
SetCell(
|
||||||
c,
|
Terrain,
|
||||||
cellsToFill[i].xPos,
|
cellsToFill[i].xPos,
|
||||||
cellsToFill[i].yPos,
|
cellsToFill[i].yPos,
|
||||||
cellsToFill[i].zPos,
|
cellsToFill[i].zPos,
|
||||||
|
|
@ -753,7 +750,7 @@ function breadthFillHelper(x, y, z, yDepthChecks)
|
||||||
end
|
end
|
||||||
|
|
||||||
On = function()
|
On = function()
|
||||||
if not c then
|
if not Terrain then
|
||||||
return
|
return
|
||||||
elseif this then
|
elseif this then
|
||||||
this:Activate(true)
|
this:Activate(true)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue