• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Month's Question

  • 17
    Posts
    10
    Years
    • Seen Nov 2, 2020
    So, I'm just thinking if has a way to making an event, that only work's in determined month. Example: A npc or a trainer that only appear in March, or in october for example. If have, how it works?? By a switch, varible, script, magic? If anyone knows how to do it, I will be very grateful. ^^
     
  • 21
    Posts
    8
    Years
    • she/her
    • Seen Apr 26, 2024
    I think a good way to do this would be to designate one of your game variables as the "Current Month," then create a script that gets the current day and sets that variable equal to the current month (i.e. 0 for January, 1 for February, etc.). You'd probably want to go into the Essentials code and have this script be called every time a map is loaded, since if someone is starts playing at 11:50 on January 31st, it would likely change month while they were still playing, and you'd want it to change the month variable as soon as possible when the month changes over IRL.

    Some quick googling will show you how to work with dates in Ruby.
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    It's easier than that. You can just use the script pbIsMonth(variableNumber,cho,sen,Mon,th) where variableNumber is the variable number that the current month (It's a string not a number) is saved to (make it less than 0 to not save a variable), while cho,sen,Mon,th is an set of numbers with the months that you want to check. If you make that 3 for example, it would return true if it's March. if it's 9,10,11,12 that would make it return true during September to December.
     
    Back
    Top