Jump to content

Austin

Member
  • Posts

    400
  • Joined

  • Last visited

Community Answers

  1. Austin's post in Secondary and Primary Weapon was marked as the answer   
    Oh. I don't think the switching works like that. I believe there is a mod for that.
     
     
    pz-mods.net
  2. Austin's post in I'm stuck and need other modders help! was marked as the answer   
    Alright, apologies.
     
    The weapons weren't actually even getting the ammo.. So I created a new .lua, just to keep separate from the distribution file, and added a new function. I looked through all the files looking for some way of getting the PrimaryHandItem. I found it. I also looked through(with some help from Aricane) stormy's reloading code. Hook.Attack.Add. That was the code I used to trigger on attack. So the code I ended up with was...
    function checkInvForAmmo(character, chargeDelta) local weapon = character:getPrimaryHandItem(); local inventory = character:getInventory(); if weapon:getType() == "bow0" then if inventory:contains("Bolts") then character:DoAttack(chargeDelta); inventory:RemoveOneOf("Bolts"); else character:setPrimaryHandItem(nil); character:say("I'm out of ammo for that weapon!"); end endendHook.Attack.Add(checkInvForAmmo);
×
×
  • Create New...