Remusutules

Random Role Picker

Jul 26th, 2023
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | Source Code | 0 0
  1. local player = game.Players.LocalPlayer
  2. local roleSelectionGui = script.Parent -- Assuming this script is placed inside
  3. local randomButton = roleSelectionGui.RandomButton
  4. local roleTextLabel = roleSelectionGui.RoleTextLabel
  5.  
  6. local roles = { "Survivor", "Detective", "Vampire" }
  7.  
  8. local function assignRandomRole()
  9. local randomIndex = math.random(1, #roles)
  10. local selectedRole = roles[randomIndex]
  11.  
  12. -- Implement your custom logic based on the selected role here.
  13. -- For example, you can set player properties or grant abilities/tools based on the role.
  14. roleTextLabel.Text = "You are a " .. selectedRole
  15. end
  16.  
  17. randomButton.MouseButton1Click:Connect(assignRandomRole)
Advertisement
Add Comment
Please, Sign In to add comment