So basically the script is suppose to place the named folder to there named places like game.Lighting folder stuff goes in lighting. SOOOOOO the serverscriptservice and serverstorage folders doesn’t go to their named places how the others do how can I fix this? https://gyazo.com/219c31d7c051a459a381dfb2878e1395
local model = game.ServerStorage:WaitForChild('GameFiles')
if model then
print("Model loaded successfully")
model.Name = 'Files'
model.Parent = game.ServerStorage
for _,Folders in pairs(model:GetChildren()) do
for _,Assets in pairs(Folders:GetChildren()) do
if Folders.Name ~= 'StarterPlayer' then
Assets:Clone().Parent = game[Folders.Name]
else
pcall(function()
print('Base Player Module Destroyed')
game.StarterPlayer.StarterPlayerScripts.PlayerModule:Destroy()
end)
for _,StarterFolders in pairs(Assets:GetChildren()) do
StarterFolders:Clone().Parent = game.StarterPlayer[StarterFolders.Parent.Name]
end
end
end
end
local MainModule = require(game.ServerScriptService:WaitForChild('MainModule'))
local PlanetList,Coordinates,PlanetNames,GravityList = MainModule.PlanetList()
script.Planet.Value = PlanetList[game.PlaceId]
print('Planet: '..script.Planet.Value)
print('Assets have sucessfully been placed.')
script.FilesLoaded.Value = true
else
print("Model failed to load!")
end
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild('Ki') == nil then
local z = Instance.new('IntValue')
z.Name = 'InfoNeeded'
z.Parent = v
print(v.Name..' started the server')
end
end
Is this a LocalScript?
Clients don’t have access to serverscriptservice or serverstorage which is why they wouldn’t be placing the folders there if that’s the case.
Try making sure that your Datastore script and your MainModule are both going to be in ServerScriptService. Putting modules in ReplicatedStorage is normally not a big deal I did that with most of my previous games but I don’t anymore due to organizations sake
DataModule and MainModule should not be in the game files, they need to be in their respective locations before the assets are copied in. I would also recommend just ungrouping your files model and copy and pasting them all into their locations.
A much better alternative to using insert service or simply copy and pasting files in is to save everything to a package, they automatically update when changed. Here is some more info on that: