Here's the source code:
using System;
using MCGalaxy;
using MCGalaxy.Commands;
namespace Server {
public sealed class DiceGame : Plugin {
public override string name { get { return "The Dice Game"; } }
public override string creator { get { return "PoldiB"; } }
public override string MCGalaxy_Version { get { return "1.9.3.8"; } }
public override void Load(bool startup) {
Command.Register(new CmdDice());
Chat.MessageGlobal("&aDice plugin succesfully loaded!");
}
public override void Unload(bool shutdown){
Command.Unregister(Command.Find("dice"));
Chat.MessageGlobal("&cDice plugin succesfully unloaded");
}
public class CmdDice : Command {
public override string name { get { return "Dice"; } }
public override string shortcut { get { return "roll"; } }
public override string type { get { return "fun"; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public override void Use(Player commandUser, string args) {
Random rnd = new Random();
int dice1 = rnd.Next(1, 6);
int dice2 = rnd.Next(1, 6);
int score = dice1 + dice2;
Chat.MessageGlobal(commandUser.name + "&fhas rolled &a" + dice1 + "&f and &a" + dice2 + "&f in Dice!");
Chat.MessageGlobal("&fThat's &a" + score + "&f points!");
}
public override void Help(Player p){
p.Message(player, "%T/dice");
p.Message(Player, "%HRoll dice.");
}
}
}
}