1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

HL2RP Attachment models selected by gender

Discussion in 'Development' started by Fruitylicious, Feb 12, 2019.

  1. Greetings,
    does anyone know how I would go about making ITEM.attachmentModel selected by gender?
    I have a male and female model attachment model, and instead of making two different items, I believe there must be a way to make it figure out what gender you are and base the ITEM.attachmentModel line off of that.

    I've tried this so far, doesn't seem to work - no errors or anything, just not selecting the right model:
    Code:
    local ITEM = Clockwork.item:New();
    ITEM.name = "Test attachment";
    ITEM.cost = 0;
    ITEM.model = "models/bandmodelm.mdl";
    ITEM.weight = 0;
    ITEM.category = "Bands";
    ITEM.uniqueID = "bandm";
    ITEM.business = false;
    ITEM.examineOveride = true;
    ITEM.description = "A band description.";
    ITEM.isAttachment = true;
    ITEM.attachmentModel = "models/bandmodelm.mdl";
    ITEM.attachmentBone = "ValveBiped.Bip01_R_UpperArm";
    ITEM.attachmentOffsetAngles = Angle(male offset angle goes here);
    ITEM.attachmentOffsetVector = Vector(male offset vector goes here);
    
    -- Called when the attachment offset info should be adjusted.
    function ITEM:AdjustAttachmentOffsetInfo(player, entity, info)
        if (player:GetGender() == GENDER_FEMALE) then
            info.offsetAngle = Angle(342, 82.42, 146.84);
            info.offsetVector = Vector(0.663, -0.414, 7.18);
        end;
    end;
    
    -- Called when the attachment model info should be adjusted.
    function ITEM:AdjustAttachmentModel(player, entity, info)
        if (player:GetGender() == GENDER_FEMALE) then
            info.attachmentModel = "models/bandmodelf.mdl";
        end;
    end;
     
  2. duck

    duck Phant0m Legend

  3. dead flag blues

    dead flag blues "...ours is a world of nuclear giants..." Clockwork Customer

    Create two separate items and script it to decline the other gender.
     

Previous Readers (Total: 0)