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!

Foot Steps

Discussion in 'Development' started by _HappyGoLucky, Feb 16, 2015.

  1. _HappyGoLucky

    _HappyGoLucky Clockwork Customer

    So I am trying to make foot steps for a faction when they walk but one thing I am confused on is this line of code,

    Code:
    if (string.find(model, "metrocop") or string.find(model, "shockcp") or string.find(model, "ghostcp") or string.find(model, "police")) then
    I do not get where it gets the metrocop from! I am guessing it is like taking out the models/ and .mdl but when I search for metrocop on gmod no results come up for me.

    I am trying to insert the model of models/zombie/fast.mdl
     
  2. Rhenz

    Rhenz Who needs a map? Staff Member Moderator Legend

    If I'm thinking correctly, metrocop is the default Metropolice model when you first get a character. It's in one of the Clockwork content packs, by Mr.Brightside.
     
  3. _HappyGoLucky

    _HappyGoLucky Clockwork Customer

    I don't see metrocop in the pack. Just looked.
     
  4. Rhenz

    Rhenz Who needs a map? Staff Member Moderator Legend

    Not too sure then. It is just part of the string name, so anything that has "metrocop" would work, I suppose. I can't really help you any further, sorry.
     
  5. NightAngel

    NightAngel Fuck off Lev

    string.find is a function that searches for a certain string in another string, in this case "metrocop", "shockcp", "ghostcp", or "police". The 'model' variable is declared earlier in the function with player:GetModel(), which returns the string of the player's current model. These strings are probably in the model paths of most if not all the metropolice models that are out there, which is probably why they were chosen.

    So what it is doing is taking the model string, then seeing if it has any of those keywords in the string, and if it does, then it gets past the logic gate and runs the code. Keep in mind that the keywords it is searching for is not the entire model path.
     

Previous Readers (Total: 0)