How do i make a server script run before others

Basically, i have a script that disables other scripts so i won’t have to disable every script i make for the map. I have a task.wait in a script that errors after the wait time ends (literally 25 seconds) which means that for some reason the thread continues. this is my script:

script.Parent.Parent = game.ServerStorage
local scripts = game.ServerStorage.Maps:GetDescendants()
for index = 1, #scripts do
	if scripts[index]:IsA("Script") then
		scripts[index].Enabled = false
	end
end

(numeric for loop since it’s slightly faster)

3 Likes

If you run it in the console then they wont run at all when the game starts.

3 Likes

i know but i didn’t want to do that every time i add a script

1 Like

You can make the map scripts module scripts and require them.

2 Likes

that would work but it’d also be painful. i think i’ll just command line everything

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.