Anathema 0 Posted May 7, 2016 So here's the deal, I made some basic starter kits based on the occupation, but I'd like to be able to do things like spawning the pistol fully loaded as opposed to giving the player a handful of rounds to load manually (unsuccessful attempt below). Something else I've been wondering, is there a more elegant way of spawning an item multiple times? (see burgerflipper) Spoiler function GiveOccupationItems(player,square) local profession = player:getDescriptor():getProfession(); if profession == "fireofficer" then player:getInventory():AddItem("Base.Axe"); elseif profession == "policeofficer" then local firearm = player:getInventory():AddItem("Base.Pistol"); firearm.setClipSize(15); player:getInventory():AddItem("Base.Torch"); --snip elseif profession == "burgerflipper" then player:getInventory():AddItem("Base.Pan"); player:getInventory():AddItem("Base.Pop"); player:getInventory():AddItem("Base.Pop"); player:getInventory():AddItem("Base.Pop"); --snip end end Events.OnNewGame.Add(GiveOccupationItems) I've already tried my best in finding a solution for both, but I've come up with nothing. Most people just seem to resort to the more simple and crude solutions. Thank you in advance. Quote Share this post Link to post Share on other sites
Anathema 0 Posted May 7, 2016 So far I've figured out spawning an item multiple times: Spoiler elseif profession == "burgerflipper" then player:getInventory():AddItem("Base.Pan"); player:getInventory():AddItems("Base.Pop", 2); I'd still like to know how to spawn a pistol with a full magazine inside it. Quote Share this post Link to post Share on other sites
SandyBeaches 13 Posted June 6, 2016 I'd probably add the pistol to inventory, then find the spawned object in player inventory and change its properties. Quote Share this post Link to post Share on other sites