Help with a simple script

By CJCS 10 months ago

I'm no coder, but i'd like to start learning. Basically this is what i would like the script to do:

[[+moveleft + +attack = +moveright + -moveleft]] [[+moveright + +attack = +moveleft + -moveright]]

My problem is : I don't know all the shenanegans to put it together. Any help would be MUCH appreciated.

5 posts 408 views
  • You must be a member

Replies

  • Devieus's Levels
    • P3: Peasant
      Points: 23,421
    • E2: Guide
      EF: 26
    • C2: Treehouse Member
    • A4: Graduate
      Account Age: 3 years
    Username
    Devieus
    Posted 10 months ago

    So you want it to circlestrafe? You've got a better chance of getting help if you tell us what you want, not make up a pseudo-code.

    User Title
    Sentinel of the TV remote
  • CJCS's Levels
    • P1: Beggar
      Points: 14
    • C1: Member
    • A2: Tenderfoot
      Account Age: 10 months
    Posted 10 months ago

    LOL. sorry man. I want to be able to strafe and when i shoot, stop motion. (by hitting the corresponding directional strafe key.)

    Bananite
  • Glecas's Levels
    • P1: Beggar
      Points: 146
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    Here try this: It's a null-cancelling movement script with the "fire-stop-move"-function u wanted. It measn that if you fire you stop moving - when you stop attacking, you will move again ;)

    // ======
    // SCRIPT
    // ======
    alias +FirStpMov "-moveleft; -moveright; +attack"
    alias -FirStpMov "-attack; checkleft; checkright"
    alias +mleft "-moveright;+moveleft;alias checkleft +moveleft"
    alias +mright "-moveleft;+moveright;alias checkright +moveright"
    alias -mleft "-moveleft;checkright;alias checkleft null"
    alias -mright "-moveright;checkleft;alias checkright null"
    alias checkleft none
    alias checkright none
    alias null""
    
    // ==========
    // BIND KEYS
    // ==========
    bind mouse1 "+FirStpMov"    // Bind mouse1 to attack.
    bind A "+mleft"         // Bind A key to move left. Assuming you use WASD.
    bind D "+mright"        // Bind D key to move right.
    

    Hope it works for you! ;)

    Bananite
  • CJCS's Levels
    • P1: Beggar
      Points: 14
    • C1: Member
    • A2: Tenderfoot
      Account Age: 10 months
    Posted 10 months ago

    i love you.

    Bananite
  • Glecas's Levels
    • P1: Beggar
      Points: 146
    • C1: Member
    • A2: Tenderfoot
      Account Age: 11 months
    Posted 10 months ago

    =) u welcome

    Bananite
  • You must be a member