Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createClass(primaryWeapon, secondaryWeapon, taticalWeapons)
- --[[ >>> EXAMPLE <<<
- createClass({"AN-94", attachment = {"Red Hot Sight", "Laser Sight", "Supressor"}, {"Executioner", attachment = {"Fast Reload", "Laser Sight", "Extended Mags"}, {"C-4", "Tatical Grenades"}}})
- ]]
- local error = nil
- local primary = nil
- local secondary = nil
- local pAttachment = nil
- local sAttachment = nil
- local taticals = nil
- if type(primaryWeapon) ~= 'table' then
- error = debug.traceback("Table expected(got, " .. type(primaryWeapon) .. ").")
- end
- if type(secondaryWeapon) ~= 'table' then
- error = debug.traceback("Table expected(got, " .. type(secondaryWeapon) .. ").")
- end
- if type(taticalWeapons) ~= 'table' then
- error = debug.traceback("Table expected(got, " .. type(taticalWeapons) .. ").")
- end
- primary = setPrimaryWeapon(custom1, primaryWeapon[1])
- secondary = setSecondaryWeapon(custom1, secondaryWeapon[1])
- for _, P in pairs(primaryWeapon.attachment)
- pAttachment = addAttachment(custom1, primary, P)
- end
- for _, S in pairs(secondaryWeapon.attachment)
- sAttachment = addAttachment(custom1, secondary, S)
- end
- for T = 1, #taticalWeapons do
- taticals = addTaticals(custom1, taticalWeapons[T])
- end
- if not error then
- class = setClassWeapons(custom1, primary, secondary, pAttachment, sAttachment, taticals)
- else
- print(error)
- end
- return classOutput(class)
- end
Advertisement
Add Comment
Please, Sign In to add comment