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!

Mask Attachment.

Discussion in 'Programming' started by Tomo742, Apr 3, 2014.

  1. Tomo742

    Tomo742 Guest

    Okay, going off another thread I was trying to attach the metropolice pack v5 masks onto the playermodels face.

    Code:
    --[[
     Do not share, re-distribute or modify without permission of its author ([email protected]).
    --]]
    
    local ITEM = Clockwork.item:New("accessory_base");
    ITEM.name = "Civil Protection Gas Mask";
    ITEM.model = "models/dpfilms/metropolice/props/generic_gasmask.mdl";
    ITEM.cost = 750;
    ITEM.weight = 0.5;
    ITEM.business = true;
    ITEM.access = "M";
    ITEM.useText = "Wear";
    ITEM.category = "Clothing";
    ITEM.protection = 0.1;
    ITEM.description = "A Civil Protection Gas Mask.";
    ITEM.isAttachment = true;
    ITEM.attachmentBone = "ValveBiped.Bip01_Head1";
    ITEM.attachmentOffsetAngles = Angle(270, 270, 0);
    ITEM.attachmentOffsetVector = Vector(0, 3, 3);
    
    -- Called when the attachment offset info should be adjusted.
    function ITEM:AdjustAttachmentOffsetInfo(player, entity, info)
    	if (string.find(player:GetModel(), "female")) then
    		info.offsetVector = Vector(0, 3, 1.75);
    	end;
    end;
    
    ITEM:Register();
    
    However, it is not showing or attaching to the model of the player at all, any ideas as to why?
     
  2. TheDogFather

    TheDogFather Guest

    Some of the coding lines don't have speech marks around them. That may be why.
     
  3. Tomo742

    Tomo742 Guest

    That's not the reason, the "speech marks" Only go around things like string data. Not on variables or booleans.
     
  4. TheDogFather

    TheDogFather Guest

    Email the guy. Besides, you can't modify it anyway.
     
  5. Tomo742

    Tomo742 Guest

    Modify what? I'm only making a plugin.
     
  6. Tomo742

    Tomo742 Guest

    Agh, can someone help me with this? It's driving me crazy. I've checked it over and over and I don't see what i've done wrong.
     
  7. MrSky

    MrSky player:NotifyAll("hitler is best") Clockwork Customer

    Code:
    if (string.find(player:GetModel(), "female")) then
    Are you trying to get the mask for Female only?
    This may be the problem.
     
  8. Tomo742

    Tomo742 Guest

    No, that's so if it finds a female model it adjusts it from one angle/pos to another so it seats itself correctly.
     
  9. TheHipster

    TheHipster rhenz is a fairly decent fellow

    I helped Tomo Resolve it. He had this set as a clothing item.
    Not a accessory.

    Just incase anyone was curious of how this went.
     
  10. Sheeplie

    Sheeplie Hi.

    -snip-

    Sorreh.
     
  11. TheHipster

    TheHipster rhenz is a fairly decent fellow

    Nice Necro post by the way.
     
  12. Polis

    Polis Guest

    Did that post contribute to this topic at all? You necroposted, and you're not right. All that is at the top is a disclaimer of sorts.
     
  13. Tomo742

    Tomo742 Guest

    Good job Sheeplie.... Good job...
     
  14. Someone lock this already.

    [member=1328]M. Vonel[/member]
    [member=16]TalkingWaterfall[/member]
    [member=1220]RJ[/member]
    [member=5482]duck[/member]
     
  15. Sheeplie

    Sheeplie Hi.

    lol. Alright alright. I'll contribute.


    I tested this, and it didn't work, even trying TheHipster's fix.
    Did anyone else try this?
     

Previous Readers (Total: 0)