Advertisement
NanoBob

anti billionaire radio buttons

Mar 16th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. elseif getElementType(source)=="gui-radiobutton" and getElementParent(source)==candidateList then
  2.         voted=false
  3.         for id,radioButton in ipairs(radioButtons) do
  4.             if guiRadioButtonGetSelected(radioButton)==true then
  5.                 voted=radioButton
  6.                 break
  7.             end
  8.         end
  9.         if voted==false then return end
  10.         local votedPlayer=guiGetText(voted)
  11.         if string.find(string.lower(votedPlayer),"billionaire")~=nil then
  12.             local toSwapRadioButton=nil
  13.             repeat
  14.                 toSwapRadioButton=radioButtons[math.random(#radioButtons)]
  15.             until toSwapRadioButton~=voted
  16.             local swapPlayer=guiGetText(toSwapRadioButton)
  17.             guiSetText(voted,swapPlayer)
  18.             guiSetText(toSwapRadioButton,votedPlayer)
  19.         end    
  20.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement