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

Just want to know: Will this script work as a queue?

Asked by 3 years ago

Here is my code:

local leaderDead = false

game.Players.PlayerAdded:Connect(function(plr)
    if game.Workspace.leaderQueue.Surface.board.CurrentLeader.TextLabel.Text == '' then
        game.Workspace.leaderQueue.Surface.board.CurrentLeader.TextLabel.Text = plr.Name
        leaderDead = false
    elseif game.Workspace.leaderQueue.Surface.board.QueuePos1.TextLabel.Text == '' then
        game.Workspace.leaderQueue.Surface.board.QueuePos1.TextLabel.Text = plr.name
    elseif game.Workspace.leaderQueue.Surface.board.QueuePos2.TextLabel.Text == '' then
        game.Workspace.leaderQueue.Surface.board.QueuePos2.TextLabel.Text = plr.name
    elseif game.Workspace.leaderQueue.Surface.board.QueuePos3.TextLabel.Text == '' then
        game.Workspace.leaderQueue.Surface.board.QueuePos3.TextLabel.Text = plr.name
    end

    local leader = game.Worskpace.leaderQueue.Surface.board.CurrentLeader.TextLabel.Text
    while true do
        if game.Worskpace['leader'].Humanoid.Health == 0 then
            game.Worskpace.leaderQueue.Surface.board.CurrentLeader.TextLabel.Text = game.Worskpace.leaderQueue.Surface.board.QueuePos1.TextLabel.Text
            game.Worskpace.leaderQueue.Surface.board.QueuePos1.TextLabel.Text = game.Workspace.leaderQueue.Surface.board.QueuePos2.TextLabel.Text
            game.Worskpace.leaderQueue.Surface.board.QueuePos2.TextLabel.Text = game.Workspace.leaderQueue.Surface.board.QueuePos3.TextLabel.Text
            game.Workspace.leaderQueue.Surface.board.QueuePos3.TextLabel.Text = ''
        end
    end
end)

Sorry that it's a bit long.

0
i have no friends to test it with PufferfishDev 49 — 3y
0
i have no friends to test it with PufferfishDev 49 — 3y
0
You can playtest with yourself using 2+ different clients in the test tab aurich98 86 — 3y
0
i have no friends to test it with PufferfishDev 49 — 3y
0
You don't need to. Using the test tool you can control 2 different clients alone aurich98 86 — 3y

Answer this question