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

Increased chance gamepasss?

Hi there! I am trying to make an increased chance gamepass! My idea was that if they have the gamepass it puts you in the table in twice, but this doesn't work and i'm not really sure! The line that i think is broken is list = list + v + v Any help will be great! Thanks!


function ChoosePlayers()

    local list = {}

    local id = 103728213

    for i,v in pairs(game.Players:GetPlayers()) do

        if Game:GetService("GamePassService"):PlayerHasPass(v, id) then

            list = list + v + v -- if they have the gamepass, put them in the table twice

            else list = list + v -- if they don't have the gamepass just put them in once

        end

    end

end

1 answer

✓ Accepted answer
function ChoosePlayers()

    local list = {}

    local id = 103728213

    for i,v in pairs(game.Players:GetPlayers()) do
	table.insert(list, v)--everyone is inserted once
        if Game:GetService("GamePassService"):PlayerHasPass(v, id) then
		table.insert(list, v)--again if they have the pass
        end

    end

end


1 comment

0

How did i get the -1 ._.

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