Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. local MASTER = { -- index the table with the variable MASTER
  2. ["gunshot"] = { -- index another table within our master table with the string key "gunshot". a key is akin to an identifier within a table
  3. [1] = { -- index a table with a number value because we don't need to identify this. this would be the equivalent of injury == 10
  4. "gunshot_left_leg", -- list all of our injuries
  5. "gunshot_chest"
  6. }
  7. }
  8. }
  9.  
  10. local group = MASTER[args[1]] -- args[1] in this case we'll say is "gunshot", text specified when the command is used
  11. local subgroup = table.Random(group) -- because the value of "group", the ["gunshot"] index is a table filled with multiple tables, we can use table.Random on it to get a random table
  12.  
  13. for k, v in pairs (subgroup) do -- for every value in the subgroup, add the injury
  14. AddInjury(target, v);
  15. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement