Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Whats wrong with the Functions and Events in this script?

if playerCount.Changed then 
	connect (Start)
end
function Start()
	game.Workspace.Message:remove()
	connect (loadup)
end
function loadup()
	for loadup1 = 10, 1, -1 do
		startup1 = Instance.new("Hint", Workspace)
		startup1.Text = " Starting in "..loadup1
	 	 wait(1)
		game.Workspace.Message:remove()
	end
end
if playerCount.Changed then --Please Help
	connect (choice)
end
function choice()
	if playerCount == 2 or 3 then-- And this
		connect (Start1)
	end
	function Start1()
	game.ServerScriptService["500m Script"].Disabled = false
	end
	end
if playerCount >= 4 then
	game.ServerScriptService["500m Script"].Disabled = true
    local Map1 = Game.ServerStorage.Map1
	local Map2 = Game.ServerStorage.Map2
	Map = math.random(Number)
	if Map == 1 then
		connect (Map1) 
			function Map1()
				game.ServerScriptService["500m Script"].Disabled = false
			end
	elseif Map == 2 then
		connect (Map2)
	function Map2()
		game.ServerScriptService["1000m Script"].Disabled = false
	end
	end
end

1 answer

✓ Accepted answer

Disabling and Enabling scripts will not start and stop them. Use real API calls, through _G or BindableFunctions or BindableEvents.


You haven't defined connect in this script.


You should not define (these) functions inside of other functions. Move them up above. It appears this will cause at least one error.

This discussion is preserved as it was. New answers, comments, and votes are closed.