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

2x chances of becoming "The Killer"?

Asked by 10 years ago

I was wondering how I could make it so someone is the killer twice as much more than anyone else. Any ideas? Thanks.

1 answer

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

Throw everyone's name into a table for one to be chosen randomly out of it, and for each player with twice the chance, put their name in the table twice.

local twice={['1waffle1']=true,['peoplemove12']=true}
local t={}
for _,v in pairs(game.Players:GetPlayers())do
    t[#t+1]=v.Name
    if twice[v.Name]then
        t[#t+1]=v.Name
    end
end

local chosen=t[math.random(1,#t)]
Ad

Answer this question