• There is an important update regarding account security and 2FA. Please click here for more information.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

Simple Run Script(Sphere)

Booda Sack

Sphere Master
  • 300
    Posts
    21
    Years
    I'll work on more in depth tut's but for the moment,here is a simple but very effective script.

    Code:
    BindKey (KEY_ALT, "OnRunKeyPressed()", "OnRunKeyReleased()");
    var runsprite ="Hero.rss";
    var walksprite="HeroRun.rss";
    var running=false;
    
    function OnRunKeyPressed()
    {
    
    SetPersonSpriteset("hero", LoadSpriteset(runsprite));
    
    SetPersonSpeed("hero",2);
    }
    
    function OnRunKeyReleased() {
    
    SetPersonSpriteset("hero", LoadSpriteset(walksprite));
    
    SetPersonSpeed("hero", 1);   // stop running
    }
    I'll go through it.
    First line sets the Alt key as the run key.
    Then are some variables declared so you can set the Run/Walk sprite

    Then the function for when the runkey is pressed/released
    If you have questions,ask.
    If you want to know more about sphere's built in functions check out the "doc_functions.txt" that comes with sphere.
     
    Hm... this tutorial is very effective :) Although, I am not using Sphere, it may make good reference. It know 80% of it, 'cause, I know Java Script [web based], not the Sphere one, though. If I would rate it, I would give it a 10 out of 10 :)

    OFF TOPIC:
    1500 Posts!!!! YAYAYAYAY!!!
     
    Back
    Top