So i got the bright idea to turn all my base scripts to packages. I did it and now i’m here.
50/50 chance of it all working correctly in the client (in studio it works 90% and my base scripts are fine). Also terrain does this:
Based on this, and the fact that the following things are messed up: terrain, physics, ect… i’ve concluded that maybe it tries to load my scripts before or while loading main things. Loading order is messed up basically.
Structure:
ServerScriptService
:
EssentialsLoader
is… the loader (potential problem source)
ServerStorage
:
SummitEssentials
are my aforementioned base scripts
PlaceSpecific
if things need to be overwritten like ui elements being enabled/disabled
The loader just compares the contents of the PlaceSpecific
and SummitEssentials
folders and inserts it to their places.
What’s inside the SummitEssentials
:
Loader script: (don’t mine it being leaked cuz… it just compares 2 folders )
essentials = game.ServerStorage.SummitEssentials
placeSpecific = game.ServerStorage:FindFirstChild("PlaceSpecific")
if placeSpecific ~= nil then
local placeSpecificChildren = placeSpecific:GetChildren()
for i = 1, #placeSpecificChildren, 1 do
local folderToCheck = essentials:FindFirstChild(placeSpecificChildren[i].Name)
if folderToCheck == nil then
placeSpecificChildren[i].Parent = essentials
else
local placeSpecificFolderChildren = placeSpecificChildren[i]:GetChildren()
for j = 1, #placeSpecificFolderChildren, 1 do
if folderToCheck:FindFirstChild(placeSpecificFolderChildren[j].Name) ~= nil then
folderToCheck[placeSpecificFolderChildren[j].Name]:Destroy()
end
placeSpecificFolderChildren[j].Parent = folderToCheck
end
end
end
placeSpecific:Destroy()
end
specialFolders = {essentials.StarterPlayerScripts, essentials.StarterCharacterScripts}
for i = 1, 2, 1 do
local tempChildren = specialFolders[i]:GetChildren()
local to = game.StarterPlayer:FindFirstChild(specialFolders[i].Name)
for j = 1, #tempChildren, 1 do
tempChildren[j].Parent = to
end
specialFolders[i]:Destroy()
end
essentialsChildren = essentials:GetChildren()
for i = 1, #essentialsChildren, 1 do
local tempChildren = essentialsChildren[i]:GetChildren()
local to = game:FindFirstChild(essentialsChildren[i].Name)
for j = 1, #tempChildren, 1 do
tempChildren[j].Parent = to
end
end
essentials:Destroy()
game.StarterPlayer.StarterPlayerScripts:FindFirstChild("PlayerModule"):Destroy()
game.StarterPlayer.StarterPlayerScripts:FindFirstChild("RbxCharacterSounds"):Destroy()
game.StarterPlayer.StarterPlayerScripts:FindFirstChild("PlayerScriptsLoader"):Destroy()
script:Destroy()
So the questions lined up:
Is the load order really what’s wrong?
Can i somehow fix it?
Can i load my scripts before the game loads?
Am i even on the right track?
Any help is appreciated.