Advertisement
HowToRoblox

RolePickerScript

Jan 23rd, 2020
10,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local killerWeapon = game.ServerStorage.ClassicSword
  2.  
  3. local plrs = game.Players
  4.  
  5. local survivors = {}
  6.  
  7.  
  8. while wait(20) do
  9.        
  10.     local chosen = plrs:GetChildren()[math.random(1, #plrs:GetChildren())] 
  11.            
  12.     chosen.PlayerGui.Picker.Background.RoleGiven.Text = "Murderer"
  13.     chosen.PlayerGui.Picker.Background.RoleGiven.TextColor3 = Color3.fromRGB(255, 0, 0)
  14.                    
  15.     chosen.PlayerGui.Picker.Background.Visible = true
  16.    
  17.     killerWeapon:Clone().Parent = chosen.Backpack
  18.    
  19.            
  20.     for i, plr in pairs(plrs:GetChildren()) do
  21.        
  22.         if plr ~= chosen then
  23.            
  24.             table.insert(survivors, plr)
  25.  
  26.             plr.PlayerGui.Picker.Background.RoleGiven.Text = "Survivor"
  27.             plr.PlayerGui.Picker.Background.RoleGiven.TextColor3 = Color3.fromRGB(0, 255, 0)
  28.            
  29.             plr.PlayerGui.Picker.Background.Visible = true
  30.            
  31.         end
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement