Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats wrong with the Functions and Events in this script?

Asked by
gecko95 20
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

Ad

Answer this question