Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MASTER = { -- index the table with the variable MASTER
- ["gunshot"] = { -- index another table within our master table with the string key "gunshot". a key is akin to an identifier within a table
- [1] = { -- index a table with a number value because we don't need to identify this. this would be the equivalent of injury == 10
- "gunshot_left_leg", -- list all of our injuries
- "gunshot_chest"
- }
- }
- }
- local group = MASTER[args[1]] -- args[1] in this case we'll say is "gunshot", text specified when the command is used
- 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
- for k, v in pairs (subgroup) do -- for every value in the subgroup, add the injury
- AddInjury(target, v);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement