Fix global variables in corescripts and joinscripts to load correctly

This commit is contained in:
Lewin Kelly 2023-08-17 22:03:30 +01:00
parent de20338362
commit 29f87521ab
5 changed files with 19 additions and 11 deletions

View File

@ -9463,8 +9463,8 @@ declare class DataModel extends ServiceProvider
function SetFastStringForTesting(self, name: string, newValue: string): string function SetFastStringForTesting(self, name: string, newValue: string): string
function SetFlagVersion(self, name: string, version: number): nil function SetFlagVersion(self, name: string, version: number): nil
function SetIsLoaded(self, value: boolean, placeSizeInBytes: number?): nil function SetIsLoaded(self, value: boolean, placeSizeInBytes: number?): nil
function SetPlaceId(self, placeId: number, idk: boolean): nil function SetPlaceId(self, placeId: number, idk: boolean?): nil
function SetPlaceID(self, placeId: number, idk: boolean): nil function SetPlaceID(self, placeId: number, idk: boolean?): nil
function SetUniverseId(self, universeId: number): nil function SetUniverseId(self, universeId: number): nil
function Shutdown(self): nil function Shutdown(self): nil

View File

@ -1,6 +1,7 @@
{ {
rules: [ rules: [
"remove_spaces", "remove_spaces",
"remove_compound_assignment",
"group_local_assignment", "group_local_assignment",
// "compute_expression", // "compute_expression",
"remove_unused_if_branch", "remove_unused_if_branch",
@ -9,5 +10,9 @@
// "remove_method_definition", // "remove_method_definition",
"remove_function_call_parens", "remove_function_call_parens",
"filter_after_early_return", "filter_after_early_return",
{
rule: "rename_variables",
globals: ["$default", "$roblox"],
},
], ],
} }

View File

@ -11,8 +11,8 @@ local functionTable = {}
local buttonVector = {} local buttonVector = {}
local buttonScreenGui, buttonFrame local buttonScreenGui, buttonFrame
local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756" local ContextDownImage = "http://banland.xyz/asset/?id=97166756"
local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444" local ContextUpImage = "http://banland.xyz/asset/?id=97166444"
local oldTouches = {} local oldTouches = {}

View File

@ -10,6 +10,8 @@ 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
-- MultiplayerSharedScript.lua inserted here ------ Prepended to Join.lua -- -- MultiplayerSharedScript.lua inserted here ------ Prepended to Join.lua --
pcall(function() pcall(function()
@ -154,7 +156,7 @@ function requestCharacter(replicator)
end end
-- called when the client connection is established -- called when the client connection is established
function onConnectionAccepted(url, replicator) function onConnectionAccepted(_, replicator)
connectResolved = true connectResolved = true
local waitingForMarker = true local waitingForMarker = true
@ -241,7 +243,8 @@ local success, err = pcall(function()
connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed) connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed)
Client.Ticket = "" Client.Ticket = ""
local playerConnectSuccess, player = pcall(function() local playerConnectSuccess
playerConnectSuccess, player = pcall(function()
return Client:PlayerConnect( return Client:PlayerConnect(
_USER_ID, _USER_ID,
"_SERVER_ADDRESS", "_SERVER_ADDRESS",

View File

@ -11,13 +11,13 @@ local GamePassService = game:GetService "GamePassService"
local Visit = game:GetService "Visit" local Visit = game:GetService "Visit"
local ScriptContext = game:GetService "ScriptContext" local ScriptContext = game:GetService "ScriptContext"
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--
do pcall(function()
pcall(function() return game:SetPlaceID(_PLACE_ID)
return game:SetPlaceID(_PLACE_ID) end)
end)
end
local message = Instance.new "Message" local message = Instance.new "Message"