Simple Question!

Just a simple question how does this work…


ply:Give()

do i have to do


ply:Give("weapon_rpg")
and
ply:Give("weapon_crossbow")

or can i do


ply:Give("weapon_rpg","weapon_crossbow","weapon_pistol","weapon_smg1")

[lua]local weapon_table= {“weapon_rpg”,
“weapon_crossbow”,
“weapon_pistol”,
“weapon_smg1”}

for _, weapons in ipairs(weapon_table) do
ply:Give(weapons)
end[/lua]

The function ply:Give() only accepts one argument that is a string, and the string is the class name of an existing weapon.

You could make a function like this for example to give multiple weapons.
[lua]
local Player = FindMetaTable(“Player”)
if !Player then return end

–Example usage: Player:GiveWeapons(“class_gun1”, “class_gun2”)
function Player:GiveWeapons(…)
local tbl = {…}
for k,v in ipairs(tbl) do
self:Give(v)
end
end
[/lua]

Alright, thanks