Traitor Chance

I usually don’t come to forums asking for help. I am a pretty good Lua coder and I prefer to help others… but now I need help. I have searched and searched and searched, maybe I haven’t searched enough, but I can’t find the right folder nor “command” / function to change the percentage for certain user groups in ULX to have higher chances at Traitor OR Detective. If anyone could… please help.


(User was banned for this post ("Help & Support" - Orkel))

[lua]
if player usergroup
v = math.Random(1, 100)
if v >= insert number here
player setRole(ROLE_TRAITOR/DETECTIVE)
end
[/lua]
do you get my pseudocode? create it yourself.

If I recall correctly, the way TTT does it is take the player list and shuffle, then it grabs off the top. You’d have to completely rewrite the way it chooses traitors and detectives to consider weights. Look up how to mathematically weight chance, from there it’s just a matter of turning it into code.

Also this post might be better suited for: http://facepunch.com/forums/65