1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Money Printer Wont Explode

Discussion in 'DarkRP Modding Questions & Help' started by Jaydawg, Jan 3, 2014.

  1. Jaydawg

    Jaydawg New Member

    Hello,

    I've added a money printer everything fine with it but when i come to lets say shooting it with m9k weapons or a default css gun it gives me a error here are the errors.

    Code (Text):
    M9K Specialties] addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:51: bad argument #1 to 'getPhrase' (string expected, got nil)
      1. getPhrase - [C]:-1
      2. Destruct - addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:51
        3. unknown - addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:38
        4. FireBullets - [C]:-1
          5. ShootBullet - lua/weapons/bobs_gun_base/shared.lua:279
          6. ShootBulletInformation - lua/weapons/bobs_gun_base/shared.lua:239
            7. unknown - lua/weapons/bobs_gun_base/shared.lua:162
    Code (Text):
    [ERROR] addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:55: bad argument #1 to 'getPhrase' (string expected, got nil)
      1. getPhrase - [C]:-1
      2. BurstIntoFlames - addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:55
        3. unknown - addons/darkrpmodification/lua/entities/bronze_moneyprinter/init.lua:36
        4. FireBullets - [C]:-1
          5. CSShootBullet - gamemodes/darkrp/entities/weapons/weapon_cs_base2/shared.lua:252
          6. unknown - gamemodes/darkrp/entities/weapons/weapon_cs_base2/shared.lua:212
     
    here are the links for the weapon_cs_base2 code and bronze printer init code

    init.lua link : http://pastebin.com/ayfBCSs2

    weapon_cs_base/ shared.lua link:http://pastebin.com/9xME5ky7

    i'm not good at lua so sorry if im getting something wrong.
     
  2. Bo98

    Bo98 Moderator Staff Member Contributor

    The problem is that you are telling DarkRP to find whatever you pass to DarkRP.getPhrase in the language file but DarkRP can't find it because the entry does not exist in your language file and it does not by default. You do this on lines 51 and 55 of your init.lua.

    You can do three things:
    1. Add the value to your language file. This is at darkrpmodification/lua/darkrp_language/english.lua or whatever language you have DarkRP set at. An entry would look something like this:
      • bronze_printer_exploded = "Your bronze printer has exploded!",
    2. Use a default DarkRP language phrase like "money_printer_exploded". After all, a bronze printer is just another money printer.
    3. If you don't care about multi-language support then simply replace DarkRP.getPhrase("bronze_printer_exploded") with "Your bronze printer has exploded!"
    And ditto with the one on line 55 but this time it's "bronze_printer_overheating" instead.
     
  3. Jaydawg

    Jaydawg New Member

    i tryed it and it worked thanks!
     

Share This Page