Add esc+r/l hotkeys in settings menu, remove unused corescripts, other corescript formatting improvements

This commit is contained in:
Lewin Kelly 2024-03-20 01:43:01 +00:00
parent 717e87254b
commit 6f48e7f584
8 changed files with 195 additions and 1679 deletions

View File

@ -7309,7 +7309,6 @@ declare class ServiceProvider extends Instance
LoadingGuiService: any LoadingGuiService: any
ScriptInformationProvider: ScriptInformationProvider ScriptInformationProvider: ScriptInformationProvider
JointsService: JointsService JointsService: JointsService
LogService: any
ThumbnailGenerator: ThumbnailGenerator ThumbnailGenerator: ThumbnailGenerator
function FindService(self, className: string): Instance function FindService(self, className: string): Instance
@ -7487,7 +7486,6 @@ declare class ServiceProvider extends Instance
function GetService(self, service: "LoadingGuiService"): any function GetService(self, service: "LoadingGuiService"): any
function GetService(self, service: "PersonalServerService"): PersonalServerService function GetService(self, service: "PersonalServerService"): PersonalServerService
function GetService(self, service: "Terrain"): Terrain function GetService(self, service: "Terrain"): Terrain
function GetService(self, service: "LogService"): any
function GetService(self, service: "ThumbnailGenerator"): ThumbnailGenerator function GetService(self, service: "ThumbnailGenerator"): ThumbnailGenerator
end end

File diff suppressed because it is too large Load Diff

View File

@ -1,272 +0,0 @@
-- Unused by Mercury
print "[Mercury]: Loaded corescript 38037565"
for _ = 1, 8 do
print "IF YOU SEE THIS MESSAGE, PLEASE REPORT IT TO THE MERCURY DEVELOPERS"
end
local damageGuiWidth = 5
local damageGuiHeight = 5
local function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then
return child
end
while true do
child = parent.ChildAdded:wait()
if child.Name == childName then
return child
end
end
end
-- declarations
local Figure = script.Parent
local Humanoid = waitForChild(Figure, "Humanoid")
local Torso = waitForChild(Figure, "Torso")
local config = Figure:FindFirstChild "PlayerStats"
local inCharTag = Instance.new "BoolValue"
inCharTag.Name = "InCharTag"
local hider = Instance.new "BoolValue"
hider.Name = "RobloxBuildTool"
local currentChildren, backpackTools
if config == nil then
config = Instance.new "Configuration"
config.Parent = Figure
config.Name = "PlayerStats"
end
local myHealth = config:FindFirstChild "MaxHealth"
if myHealth == nil then
myHealth = Instance.new "NumberValue"
myHealth.Parent = config
myHealth.Value = 100
myHealth.Name = "MaxHealth"
end
Humanoid.MaxHealth = myHealth.Value
Humanoid.Health = myHealth.Value
local function onMaxHealthChange()
Humanoid.MaxHealth = myHealth.Value
Humanoid.Health = myHealth.Value
end
myHealth.Changed:connect(onMaxHealthChange)
--Humanoid.MaxHealth = myHealth.Value
--Humanoid.Health = Humanoid.MaxHealth
local vPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
local dotGui = vPlayer.PlayerGui:FindFirstChild "DamageOverTimeGui"
if dotGui == nil then
dotGui = Instance.new "BillboardGui"
dotGui.Name = "DamageOverTimeGui"
dotGui.Parent = vPlayer.PlayerGui
dotGui.Adornee = script.Parent:FindFirstChild "Head"
dotGui.Active = true
dotGui.size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0)
dotGui.StudsOffset = Vector3.new(0, 2.0, 0.0)
end
print "newHealth declarations finished"
local function billboardHealthChange(dmg)
local textLabel = Instance.new "TextLabel"
textLabel.TextColor3 = dmg > 0 and Color3.new(0, 1, 0)
or Color3.new(1, 0, 1)
textLabel.Text = tostring(dmg)
textLabel.size = UDim2.new(1, 0, 1, 0.0)
textLabel.Active = true
textLabel.FontSize = 6
textLabel.BackgroundTransparency = 1
textLabel.Parent = dotGui
for t = 1, 10 do
wait(0.1)
textLabel.TextTransparency = t / 10
textLabel.Position = UDim2.new(0, 0, 0, -t * 5)
textLabel.FontSize = 6 - t * 0.6
end
textLabel:remove()
end
local function setMaxHealth()
--print(Humanoid.Health)
if myHealth.Value >= 0 then
Humanoid.MaxHealth = myHealth.Value
print(Humanoid.MaxHealth)
if Humanoid.Health > Humanoid.MaxHealth then
Humanoid.Health = Humanoid.MaxHealth
end
end
end
myHealth.Changed:connect(setMaxHealth)
-- Visual Effects --
local fireEffect = Instance.new "Fire"
fireEffect.Heat = 0.1
fireEffect.Size = 3.0
fireEffect.Name = "FireEffect"
fireEffect.Enabled = false
--
-- regeneration
while true do
local s = wait(1)
local health = Humanoid.Health
if health > 0 then -- and health < Humanoid.MaxHealth then
local delta = 0
if config then
local regen = config:FindFirstChild "Regen"
local poison = config:FindFirstChild "Poison"
local ice = config:FindFirstChild "Ice"
local fire = config:FindFirstChild "Fire"
local stun = config:FindFirstChild "Stun"
if regen then
delta += regen.Value.X
if regen.Value.Y >= 0 then
regen.Value = Vector3.new(
regen.Value.X + regen.Value.Z,
regen.Value.Y - s,
regen.Value.Z
) -- maybe have 3rd parameter be an increaser/decreaser?
elseif regen.Value.Y == -1 then
regen.Value = Vector3.new(
regen.Value.X + regen.Value.Z,
-1,
regen.Value.Z
)
else
regen:remove()
end -- infinity is -1
end
if poison then
delta -= poison.Value.X
if poison.Value.Y >= 0 then
poison.Value = Vector3.new(
poison.Value.X + poison.Value.Z,
poison.Value.Y - s,
poison.Value.Z
)
elseif poison.Value.Y == -1 then
poison.Value = Vector3.new(
poison.Value.X + poison.Value.Z,
-1,
poison.Value.Z
)
else
poison:remove()
end -- infinity is -1
end
if ice then
--print("IN ICE")
delta -= ice.Value.X
if ice.Value.Y >= 0 then
ice.Value =
Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z)
else
ice:remove()
end
end
if fire then
fireEffect.Enabled = true
fireEffect.Parent = Figure.Torso
delta -= fire.Value.X
if fire.Value.Y >= 0 then
fire.Value = Vector3.new(
fire.Value.X,
fire.Value.Y - s,
fire.Value.Z
)
else
fire:remove()
fireEffect.Enabled = false
fireEffect.Parent = nil
end
end
if stun then
if stun.Value > 0 then
Torso.Anchored = true
currentChildren = script.Parent:GetChildren()
backpackTools = game.Players
:GetPlayerFromCharacter(script.Parent).Backpack
:GetChildren()
for i = 1, #currentChildren do
if currentChildren[i].className == "Tool" then
inCharTag:Clone().Parent = currentChildren[i]
print(backpackTools)
table.insert(backpackTools, currentChildren[i])
end
end
for i = 1, #backpackTools do
if
backpackTools[i]:FindFirstChild "RobloxBuildTool"
== nil
then
hider:Clone().Parent = backpackTools[i]
backpackTools[i].Parent = game.Lighting
end
end
wait(0.2)
for i = 1, #backpackTools do
backpackTools[i].Parent =
game.Players:GetPlayerFromCharacter(script.Parent).Backpack
end
stun.Value -= s
else
Torso.Anchored = false
for i = 1, #backpackTools do
local rbTool =
backpackTools[i]:FindFirstChild "RobloxBuildTool"
if rbTool then
rbTool:Remove()
end
backpackTools[i].Parent = game.Lighting
end
wait(0.2)
for i = 1, #backpackTools do
local wasInChar =
backpackTools[i]:FindFirstChild "InCharTag"
if wasInChar then
wasInChar:Remove()
backpackTools[i].Parent = script.Parent
else
backpackTools[i].Parent =
game.Players:GetPlayerFromCharacter(
script.Parent
).Backpack
end
end
stun:Remove()
end
end
if delta ~= 0 then
coroutine.resume(coroutine.create(billboardHealthChange), delta)
end
--delta *= .01
end
--health += delta * s * Humanoid.MaxHealth
health = Humanoid.Health + delta * s
if health * 1.01 < Humanoid.MaxHealth then
Humanoid.Health = health
--myHealth.Value = math.floor(Humanoid.Health)
elseif delta > 0 then
Humanoid.Health = Humanoid.MaxHealth
--myHealth.Value = Humanoid.Health
end
end
end

View File

@ -312,13 +312,11 @@ local function setDisabledState(guiObject)
elseif guiObject:IsA "TextButton" then elseif guiObject:IsA "TextButton" then
guiObject.TextTransparency = 0.9 guiObject.TextTransparency = 0.9
guiObject.Active = false guiObject.Active = false
else elseif guiObject.ClassName then
if guiObject.ClassName then print(
print( "setDisabledState() got object of unsupported type. object type is ",
"setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName
guiObject.ClassName )
)
end
end end
end end
@ -1369,20 +1367,13 @@ local function createGameSettingsMenu(baseZIndex, _)
if hasGraphicsSlider then if hasGraphicsSlider then
UserSettings().GameSettings.FullscreenChanged:connect( UserSettings().GameSettings.FullscreenChanged:connect(
function(isFullscreen) function(isFullscreen)
if isFullscreen then fullscreenCheckbox.Text = isFullscreen and "X" or ""
fullscreenCheckbox.Text = "X"
else
fullscreenCheckbox.Text = ""
end
end end
) )
else else
fullscreenCheckbox.MouseButton1Click:connect(function() fullscreenCheckbox.MouseButton1Click:connect(function()
if fullscreenCheckbox.Text == "" then fullscreenCheckbox.Text = fullscreenCheckbox.Text == "" and "X"
fullscreenCheckbox.Text = "X" or ""
else
fullscreenCheckbox.Text = ""
end
end) end)
end end
@ -1535,6 +1526,9 @@ end
RbxGui = LoadLibrary "RbxGui" RbxGui = LoadLibrary "RbxGui"
GuiService:AddKey "l"
GuiService:AddKey "r"
local baseZIndex = 0 local baseZIndex = 0
if UserSettings then if UserSettings then
local createSettingsDialog = function() local createSettingsDialog = function()
@ -1657,82 +1651,109 @@ if UserSettings then
end) end)
end end
gameMainMenu.ResetButton.MouseButton1Click:connect(function() local function confirmReset()
goToMenu( goToMenu(
settingsFrame, settingsFrame,
"ResetConfirmationMenu", "ResetConfirmationMenu",
"up", "up",
UDim2.new(0, 525, 0, 370) UDim2.new(0, 525, 0, 370)
) )
end) end
gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() local function confirmLeave()
goToMenu( goToMenu(
settingsFrame, settingsFrame,
"LeaveConfirmationMenu", "LeaveConfirmationMenu",
"down", "down",
UDim2.new(0, 525, 0, 300) UDim2.new(0, 525, 0, 300)
) )
end) end
local hotkeysConn
local function leaveResetHotkeys(key) -- esc, r, not enter (unfortunately)
if hotkeysConn then
hotkeysConn:disconnect()
end
if key == "r" then
confirmReset()
elseif key == "l" then
confirmLeave()
end
end
local function showFunction()
settingsButton.Active = false
updateCameraDropDownSelection(
UserSettings().GameSettings.ControlMode.Name
)
if syncVideoCaptureSetting then
syncVideoCaptureSetting()
end
goToMenu(
settingsFrame,
"GameMainMenu",
"right",
UDim2.new(0, 525, 0, 430)
)
shield.Visible = true
shield.Active = true
settingsFrame.Parent:TweenPosition(
UDim2.new(0.5, -262, 0.5, -200),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
settingsFrame.Parent:TweenSize(
UDim2.new(0, 525, 0, 430),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
end
local function hideFunction()
settingsFrame.Parent:TweenPosition(
UDim2.new(0.5, -262, -0.5, -200),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
settingsFrame.Parent:TweenSize(
UDim2.new(0, 525, 0, 430),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
shield.Visible = false
settingsButton.Active = true
end
gameMainMenu.ResetButton.MouseButton1Click:connect(confirmReset)
gameMainMenu.LeaveGameButton.MouseButton1Click:connect(confirmLeave)
GuiService.EscapeKeyPressed:connect(function() GuiService.EscapeKeyPressed:connect(function()
if hotkeysConn then
hotkeysConn:disconnect()
end
-- Prevent mysterious missing settings menu bugs
delay(tweenTime, function()
if hotkeysConn then
hotkeysConn:disconnect()
end
hotkeysConn = GuiService.KeyPressed:connect(leaveResetHotkeys)
end)
if currentMenuSelection == nil then if currentMenuSelection == nil then
game.GuiService:AddCenterDialog( game.GuiService:AddCenterDialog(
shield, shield,
Enum.CenterDialogType.ModalDialog, Enum.CenterDialogType.ModalDialog,
--showFunction showFunction,
function() hideFunction
settingsButton.Active = false
updateCameraDropDownSelection(
UserSettings().GameSettings.ControlMode.Name
)
if syncVideoCaptureSetting then
syncVideoCaptureSetting()
end
goToMenu(
settingsFrame,
"GameMainMenu",
"right",
UDim2.new(0, 525, 0, 430)
)
shield.Visible = true
shield.Active = true
settingsFrame.Parent:TweenPosition(
UDim2.new(0.5, -262, 0.5, -200),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
settingsFrame.Parent:TweenSize(
UDim2.new(0, 525, 0, 430),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
end,
--hideFunction
function()
settingsFrame.Parent:TweenPosition(
UDim2.new(0.5, -262, -0.5, -200),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
settingsFrame.Parent:TweenSize(
UDim2.new(0, 525, 0, 430),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
shield.Visible = false
settingsButton.Active = true
end
) )
elseif #lastMenuSelection > 0 then elseif #lastMenuSelection > 0 then
if #centerDialogs > 0 then if #centerDialogs > 0 then

View File

@ -3,12 +3,12 @@ print "[Mercury]: Loaded corescript 48488398"
local TeleportService = game:GetService "TeleportService" local TeleportService = game:GetService "TeleportService"
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()
end end
end end
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
@ -26,13 +26,31 @@ local friendRequestBlacklist = {}
local teleportEnabled = true local teleportEnabled = true
local makePopupInvisible = function() local function makePopupInvisible()
if script.Parent.Popup then if script.Parent.Popup then
script.Parent.Popup.Visible = false script.Parent.Popup.Visible = false
end end
end end
function makeFriend(fromPlayer, toPlayer) local function showOneButton()
local popup = script.Parent:FindFirstChild "Popup"
if popup then
popup.OKButton.Visible = true
popup.DeclineButton.Visible = false
popup.AcceptButton.Visible = false
end
end
local function showTwoButtons()
local popup = script.Parent:FindFirstChild "Popup"
if popup then
popup.OKButton.Visible = false
popup.DeclineButton.Visible = true
popup.AcceptButton.Visible = true
end
end
local function makeFriend(fromPlayer, toPlayer)
local popup = script.Parent:FindFirstChild "Popup" local popup = script.Parent:FindFirstChild "Popup"
if popup == nil then if popup == nil then
return return
@ -145,25 +163,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
end end
end) end)
function showOneButton() local function showTeleportUI(message, timer)
local popup = script.Parent:FindFirstChild "Popup"
if popup then
popup.OKButton.Visible = true
popup.DeclineButton.Visible = false
popup.AcceptButton.Visible = false
end
end
function showTwoButtons()
local popup = script.Parent:FindFirstChild "Popup"
if popup then
popup.OKButton.Visible = false
popup.DeclineButton.Visible = true
popup.AcceptButton.Visible = true
end
end
function showTeleportUI(message, timer)
if teleportUI ~= nil then if teleportUI ~= nil then
teleportUI:Remove() teleportUI:Remove()
end end
@ -177,7 +177,7 @@ function showTeleportUI(message, timer)
end end
end end
function onTeleport(teleportState, _, _) local function onTeleport(teleportState)
if TeleportService.CustomizedTeleportUI == false then if TeleportService.CustomizedTeleportUI == false then
if teleportState == Enum.TeleportState.Started then if teleportState == Enum.TeleportState.Started then
showTeleportUI("Teleport started...", 0) showTeleportUI("Teleport started...", 0)

View File

@ -21,29 +21,10 @@ local function WaitForChild(parent, childName)
return parent[childName] return parent[childName]
end end
-- wtf
-- local function typedef(obj)
-- return obj
-- end
local function IsPhone() local function IsPhone()
local cGui = Game:GetService "CoreGui" local cGui = Game:GetService "CoreGui"
local rGui = WaitForChild(cGui, "RobloxGui") local rGui = WaitForChild(cGui, "RobloxGui")
if rGui.AbsoluteSize.Y < 600 then return rGui.AbsoluteSize.Y < 600
return true
end
return false
end
-- Users can use enough white spaces to spoof chatting as other players
-- This function removes trailing and leading white spaces
-- AFAIK, there is no reason for spam white spaces
local function StringTrim(str)
-- %S is whitespaces
-- When we find the first non space character defined by ^%s
-- we yank out anything in between that and the end of the string
-- Everything else is replaced with %1 which is essentially nothing
return (str:gsub("^%s*(.-)%s*$", "%1"))
end end
while Game.Players.LocalPlayer == nil do while Game.Players.LocalPlayer == nil do
@ -60,59 +41,53 @@ local Camera = Game.Workspace.CurrentCamera
local CoreGuiService = Game:GetService "CoreGui" local CoreGuiService = Game:GetService "CoreGui"
local PlayersService = Game:GetService "Players" local PlayersService = Game:GetService "Players"
local GuiService = Game:GetService "GuiService" local GuiService = Game:GetService "GuiService"
local UserInputService = Game:GetService "UserInputService"
-- Lua Enums -- Lua Enums
local Enums, CreateEnum local Enums = {}
do local EnumName = {} -- used as unique key for enum name
Enums = {} local enum_mt = {
local EnumName = {} -- used as unique key for enum name __call = function(self, value)
local enum_mt = { return self[value] or self[tonumber(value)]
__call = function(self, value) end,
return self[value] or self[tonumber(value)] __index = {
end, GetEnumItems = function(self)
__index = { local t = {}
GetEnumItems = function(self) for i, item in pairs(self) do
local t = {} if type(i) == "number" then
for i, item in pairs(self) do t[#t + 1] = item
if type(i) == "number" then
t[#t + 1] = item
end
end end
table.sort(t, function(a, b)
return a.Value < b.Value
end)
return t
end,
},
__tostring = function(self)
return `Enum.{self[EnumName]}`
end,
}
local item_mt = {
__call = function(self, value)
return value == self or value == self.Name or value == self.Value
end,
__tostring = function(self)
return `Enum.{self[EnumName]}.{self.Name}`
end,
}
CreateEnum = function(enumName)
return function(t)
local e = { [EnumName] = enumName }
for i, name in pairs(t) do
local item = setmetatable(
{ Name = name, Value = i, Enum = e, [EnumName] = enumName },
item_mt
)
e[i] = item
e[name] = item
e[item] = item
end end
Enums[enumName] = e table.sort(t, function(a, b)
return setmetatable(e, enum_mt) return a.Value < b.Value
end end)
return t
end,
},
__tostring = function(self)
return `Enum.{self[EnumName]}`
end,
}
local item_mt = {
__call = function(self, value)
return value == self or value == self.Name or value == self.Value
end,
__tostring = function(self)
return `Enum.{self[EnumName]}.{self.Name}`
end,
}
local function CreateEnum(enumName, t)
local e = { [EnumName] = enumName }
for i, name in pairs(t) do
local item = setmetatable(
{ Name = name, Value = i, Enum = e, [EnumName] = enumName },
item_mt
)
e[i] = item
e[name] = item
e[item] = item
end end
Enums[enumName] = e
return setmetatable(e, enum_mt)
end end
--------------------------------------------------- ---------------------------------------------------
------------------ Input class -------------------- ------------------ Input class --------------------
@ -183,7 +158,7 @@ local Chat = {
Admins_List = { "taskmanager", "Heliodex", "tako" }, Admins_List = { "taskmanager", "Heliodex", "tako" },
SafeChat_List = SafeChat, SafeChat_List = SafeChat,
CreateEnum "SafeChat" { "Level1", "Level2", "Level3" }, CreateEnum("SafeChat", { "Level1", "Level2", "Level3" }),
SafeChatTree = {}, SafeChatTree = {},
TempSpaceLabel = nil, TempSpaceLabel = nil,
} }
@ -462,7 +437,13 @@ function Chat:CreateMessage(cPlayer, message)
else else
pName = cPlayer.Name pName = cPlayer.Name
end end
message = StringTrim(message) -- Users can use enough white spaces to spoof chatting as other players
-- This removes trailing and leading white spaces
-- AFAIK, there is no reason for spam white spaces
-- %S is whitespaces
-- When we find the first non space character defined by ^%s we yank out anything in between that and the end of the string
-- Everything else is replaced with %1 which is essentially nothing
message = string.gsub(message, "^%s*(.-)%s*$", "%1")
local pLabel local pLabel
local mLabel local mLabel
-- Our history stores upto 50 messages that is 100 textlabels -- Our history stores upto 50 messages that is 100 textlabels
@ -610,103 +591,6 @@ function Chat:FindButtonTree(scButton, rootList)
return list return list
end end
function Chat:ToggleSafeChatMenu(scButton)
local list = Chat:FindButtonTree(scButton, self.SafeChatTree)
if list then
for button, _ in pairs(list) do
if button:IsA "TextButton" or button:IsA "ImageButton" then
button.Visible = not button.Visible
end
end
return true
end
return false
end
function Chat:CreateSafeChatOptions(list, rootButton)
local text_List = {}
local count = 0
text_List[rootButton] = {}
text_List[rootButton][1] = list[1]
rootButton = rootButton or self.SafeChatButton
for msg, _ in pairs(list) do
if type(msg) == "string" then
local chatText = New "TextButton" {
Name = msg,
Text = msg,
Size = UDim2.new(0, 100, 0, 20),
TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = Color3.new(0.2, 0.1, 0.1),
BackgroundTransparency = 0.5,
BackgroundColor3 = Color3.new(1, 1, 1),
Parent = self.SafeChatFrame,
Visible = false,
Position = UDim2.new(
0,
rootButton.Position.X.Scale + 105,
0,
rootButton.Position.Y.Scale - ((count - 3) * 100)
),
}
count += 1
if type(list[msg]) == "table" then
text_List[rootButton][chatText] =
Chat:CreateSafeChatOptions(list[msg], chatText)
-- else
-- --table.insert(text_List[chatText], true)
end
chatText.MouseEnter:connect(function()
Chat:ToggleSafeChatMenu(chatText)
end)
chatText.MouseLeave:connect(function()
Chat:ToggleSafeChatMenu(chatText)
end)
chatText.MouseButton1Click:connect(function()
local lList = Chat:FindButtonTree(chatText)
-- if lList then
-- for i, v in pairs(lList) do
-- end
-- else
-- end
pcall(function()
PlayersService:Chat(lList[1])
end)
end)
end
end
return text_List
end
function Chat:CreateSafeChatGui()
self.SafeChatFrame = New "Frame" {
Name = "SafeChatFrame",
Size = UDim2.new(1, 0, 1, 0),
Parent = self.Gui,
BackgroundTransparency = 1,
New "ImageButton" {
Name = "SafeChatButton",
Size = UDim2.new(0, 44, 0, 31),
Position = UDim2.new(0, 1, 0.35, 0),
BackgroundTransparency = 1,
Image = "http://banland.xyz/asset/?id=97080365",
},
}
self.SafeChatButton = self.SafeChatFrame.SafeChatButton
-- safe chat button is the root of this tree
self.SafeChatTree[self.SafeChatButton] =
Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton)
self.SafeChatButton.MouseButton1Click:connect(function()
Chat:ToggleSafeChatMenu(self.SafeChatButton)
end)
end
function Chat:FocusOnChatBar() function Chat:FocusOnChatBar()
if self.ClickToChatButton then if self.ClickToChatButton then
self.ClickToChatButton.Visible = false self.ClickToChatButton.Visible = false
@ -719,58 +603,6 @@ function Chat:FocusOnChatBar()
self.ChatBar:CaptureFocus() self.ChatBar:CaptureFocus()
end end
-- For touch devices we create a button instead
function Chat:CreateTouchButton()
self.ChatTouchFrame = New "Frame" {
Name = "ChatTouchFrame",
Size = UDim2.new(0, 128, 0, 32),
Position = UDim2.new(0, 88, 0, 0),
BackgroundTransparency = 1,
Parent = self.Gui,
New "ImageButton" {
Name = "ChatLabel",
Size = UDim2.new(0, 74, 0, 28),
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1,
ZIndex = 2.0,
},
New "ImageLabel" {
Name = "Background",
Size = UDim2.new(1, 0, 1, 0),
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1,
Image = "http://banland.xyz/asset/?id=97078724",
},
}
self.TapToChatLabel = self.ChatTouchFrame.ChatLabel
self.TouchLabelBackground = self.ChatTouchFrame.Background
self.ChatBar = New "TextBox" {
Name = "ChatBar",
Size = UDim2.new(1, 0, 0.2, 0),
Position = UDim2.new(0, 0, 0.8, 800),
Text = "",
ZIndex = 1,
BackgroundTransparency = 1,
Parent = self.Frame,
TextXAlignment = Enum.TextXAlignment.Left,
TextColor3 = Color3.new(1, 1, 1),
ClearTextOnFocus = false,
}
self.TapToChatLabel.MouseButton1Click:connect(function()
self.TapToChatLabel.Visible = false
--self.ChatBar.Visible = true
--self.Frame.Background.Visible = true
self.ChatBar:CaptureFocus()
self.GotFocus = true
if self.TouchLabelBackground then
self.TouchLabelBackground.Visible = false
end
end)
end
-- Non touch devices, create the bottom chat bar -- Non touch devices, create the bottom chat bar
function Chat:CreateChatBar() function Chat:CreateChatBar()
-- okay now we do -- okay now we do
@ -893,7 +725,6 @@ function Chat:CreateGui()
if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then
Chat:CreateChatBar() Chat:CreateChatBar()
-- Chat:CreateSafeChatGui()
if self.ChatBar then if self.ChatBar then
self.ChatBar.FocusLost:connect(function(enterPressed) self.ChatBar.FocusLost:connect(function(enterPressed)
@ -965,19 +796,16 @@ function Input:Initialize()
end end
function Chat:FindMessageInSafeChat(message, list) function Chat:FindMessageInSafeChat(message, list)
local foundMessage = false
for msg, _ in pairs(list) do for msg, _ in pairs(list) do
if msg == message then if
msg == message
or type(list[msg]) == "table"
and Chat:FindMessageInSafeChat(message, list[msg])
then
return true return true
end end
if type(list[msg]) == "table" then
foundMessage = Chat:FindMessageInSafeChat(message, list[msg])
if foundMessage then
return true
end
end
end end
return foundMessage return false
end end
-- Just a wrapper around our PlayerChatted event -- Just a wrapper around our PlayerChatted event
@ -997,22 +825,20 @@ function Chat:PlayerChatted(...)
end end
end end
if PlayersService.ClassicChat then if
if PlayersService.ClassicChat
not ( and (not (string.sub(message, 1, 3) == "/e " or string.sub(
string.sub(message, 1, 3) == "/e " message,
or string.sub(message, 1, 7) == "/emote " 1,
) 7
and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) ) == "/emote ") and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(
or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(
message, message,
1, 1,
3 3
) == "/sc") ) == "/sc"))
or (Chat:FindMessageInSafeChat(message, self.SafeChat_List)) or (Chat:FindMessageInSafeChat(message, self.SafeChat_List))
then then
Chat:UpdateChat(player, message) Chat:UpdateChat(player, message)
end
end end
end end
@ -1061,11 +887,7 @@ function Chat:CoreGuiChanged(coreGuiType, enabled)
if self.ChatBar then if self.ChatBar then
self.ChatBar.Visible = enabled self.ChatBar.Visible = enabled
if enabled then GuiService:SetGlobalGuiInset(0, 0, 0, enabled and 20 or 0)
GuiService:SetGlobalGuiInset(0, 0, 0, 20)
else
GuiService:SetGlobalGuiInset(0, 0, 0, 0)
end
end end
end end
end end
@ -1087,11 +909,13 @@ function Chat:Initialize()
) )
end) end)
self.EventListener = PlayersService.PlayerChatted:connect(function(...) local function chatted(...)
-- This event has 4 callback arguments -- This event has 4 callback arguments
-- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer
Chat:PlayerChatted(...) Chat:PlayerChatted(...)
end) end
self.EventListener = PlayersService.PlayerChatted:connect(chatted)
self.MessageThread = coroutine.create(function() end) self.MessageThread = coroutine.create(function() end)
coroutine.resume(self.MessageThread) coroutine.resume(self.MessageThread)
@ -1103,11 +927,7 @@ function Chat:Initialize()
-- NOTE: PlayerAdded only fires on the server, hence ChildAdded is used here -- NOTE: PlayerAdded only fires on the server, hence ChildAdded is used here
PlayersService.ChildAdded:connect(function() PlayersService.ChildAdded:connect(function()
Chat.EventListener:disconnect() Chat.EventListener:disconnect()
self.EventListener = PlayersService.PlayerChatted:connect(function(...) self.EventListener = PlayersService.PlayerChatted:connect(chatted)
-- This event has 4 callback arguments
-- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer
Chat:PlayerChatted(...)
end)
end) end)
Spawn(function() Spawn(function()

View File

@ -1,4 +1,5 @@
print "[Mercury]: Loaded Studio corescript" print "[Mercury]: Loaded Studio corescript"
local MarketplaceService = game:GetService "MarketplaceService" local MarketplaceService = game:GetService "MarketplaceService"
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local SocialService = game:GetService "SocialService" local SocialService = game:GetService "SocialService"

View File

@ -1,15 +1,14 @@
print "[Mercury]: Loaded Visit corescript" print "[Mercury]: Loaded Visit corescript"
local ChangeHistoryService = game:GetService "ChangeHistoryService" 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 = game:GetService "ScriptInformationProvider"
local SocialService = game:GetService "SocialService" local SocialService = game:GetService "SocialService"
local CoreGui = game:GetService "CoreGui"
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 ScriptContext = game:GetService "ScriptContext"
local player local player
@ -85,9 +84,6 @@ end)
workspace:SetPhysicsThrottleEnabled(true) workspace:SetPhysicsThrottleEnabled(true)
local addedBuildTools = false
local screenGui = CoreGui:FindFirstChild "RobloxGui"
function doVisit() function doVisit()
message.Text = "Loading Game" message.Text = "Loading Game"
@ -124,19 +120,6 @@ end
local success, err = pcall(doVisit) local success, err = pcall(doVisit)
if not addedBuildTools then
local playerName = Instance.new "StringValue"
playerName.Name = "PlayerName"
playerName.Value = player.Name
playerName.RobloxLocked = true
playerName.Parent = screenGui
pcall(function()
ScriptContext:AddCoreScript(59431535, screenGui, "BuildToolsScript")
end)
addedBuildTools = true
end
if success then if success then
message.Parent = nil message.Parent = nil
else else