Help! VotifierScripts

Discussion in 'Spigot Plugin Development' started by Heknon, Jun 12, 2016.

  1. Hey i made a script for votifier scripts but it dosent work or that i dont know where to put or the .txt or .dat but anyways here is the script HELP

    var requiredVotes = 10;

    function increaseVotes() {
    var voteFile = new java.io.File(plugin.getDataFolder(), "vote-counts");
    var config = org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(voteFile);
    var count = config.getInt(target + ".votes");
    count++;
    config.set(target + ".votes", count);
    config.save(voteFile);
    }

    function getVoteCount() {
    var voteFile = new java.io.File(plugin.getDataFolder(), "vote-counts");
    var config = org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(voteFile);
    return config.getInt(target + ".votes");
    }

    increaseVotes();
    if (getVoteCount() % requiredVotes == 10) {
    command("/eco give %target% 100000")
    command("/crazycrate give virtual crazy 1 %target%")
    command("/broadcast &7&l>> &d&l%target%&6&l Thanks for voting 10 times to make this server a great place to play here is some rewards: $100,000 and 2 assassination keys!")
    }
     
  2. It's not even java, its javascript. Look at where you stole the code from, a page for a plugin by the name of VotifierScripts, which hasn't been updated since 1.3.1.