Dice

Moved

Total Downloads: 623 - First Release: Oct 17, 2014 - Last Update: May 25, 2017

4.33333/5, 6 likes
  1. Wulf

    Wulf Community Admin

    Wulf submitted a new resource:

    Roll the Dice - Feeling lucky? Roll one or multiple dice to get a random number

    Read more about this resource...
     
  2. Wulf

    Wulf Community Admin

  3. Unknown chat command dice???
     
  4. Wulf

    Wulf Community Admin

    The default command is /roll actually; I've updated the description. You can change it in the config too.
     
  5. ok thx
     
  6. Wulf

    Wulf Community Admin

    Wulf updated Dice with a new update entry:

    Renamed to Dice and other minor changes

     
  7. doesnt work. the /roll command
     
  8. Wulf

    Wulf Community Admin

    Look in your config. The default is actually /dice.
     
  9. Player did this and it froze my server:p
    1:14 AM [Info] [Logger] mindthings <8 LvL> ran chat command: /dice 99999999999999999999999999999999999999999999999999
     
  10. Wulf

    Wulf Community Admin

    Ha, I'll have to add some sort of limit to it I guess.
     
  11. Wulf

    Wulf Community Admin

  12. Run against 99 quindecillion. That's impressive.
     
  13. Wulf

    Wulf Community Admin

  14. CHR

    CHR

    My topdog wulf

    Code:
    Oxide] 8:34 PM [Error] Failed to call hook 'cmdRollDice' on plugin 'Dice' (IndexOutOfRangeException: Array index is out of range.)
    [Oxide] 8:34 PM [Debug]   at NLua.MetaFunctions.GetMethodInternal (LuaState luaState) [0x00000] in <filename unknown>:0
      at NLua.MetaFunctions.GetMethod (LuaState luaState) [0x00000] in <filename unknown>:0
      at (wrapper native-to-managed) NLua.MetaFunctions:GetMethod (KeraLua.LuaState)
      at (wrapper managed-to-native) KeraLua.NativeMethods:LuaNetPCall (intptr,int,int,int)
      at KeraLua.Lua.LuaNetPCall (IntPtr luaState, Int32 nArgs, Int32 nResults, Int32 errfunc) [0x00000] in <filename unknown>:0
      at NLua.LuaLib.LuaPCall (LuaState luaState, Int32 nArgs, Int32 nResults, Int32 errfunc) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
    Jack Daniel Sama was killed by [GR] OverCooked Noodles
     
  15. Can you just make a new Funktion with Dice?
    I want to use the command /Dice .. 1h = 1/dice
    You can roll from 0-100
    If you hit 0-25 you got Trash items (Animal Fat, Cloth, Bone,Stone Hatchet...)
    If you hit25-50 you got some Resources (Wood,Sulfur,Stone...)
    if you hit50-75 you got some Bp (Rdm Bp..)
    If you hit 75-100 you got Armor (Weapons, Rockets...)

    it's possible to do a plugin like that?
     
  16. Wulf

    Wulf Community Admin

    I might eventually if I find the time.
     
  17. It doesn't say how many dice you roll. This is dumb! Lol. You need to tell people how many dice they rolled. Otherwise I can say, I rolled 2 dice and got an 11, but really I rolled 4 dice and got an 11, so odds are shifted.

    You follow? Take the count variable and publish it to the message in game. Player Y rolled X dice and got a total of #. K?
    [DOUBLEPOST=1433024696][/DOUBLEPOST]I fixed it. Here are the key things I did.

    Find
    Code:
        local number = tostring(total)
    Add, below
    Code:
        local dicecount = tostring(count)
    Find
    Code:
        local message = self.Config.Messages.Rolled:gsub("{player}", player.displayName):gsub("{number}", number)
    Change to
    Code:
        local message = self.Config.Messages.Rolled:gsub("{player}", player.displayName):gsub("{number}", number):gsub("{dicecount}", dicecount)
    Find
    Code:
        self.Config.Messages.Rolled = self.Config.Messages.Rolled or "{player} rolled {number}"
    Change to
    Code:
        self.Config.Messages.Rolled = self.Config.Messages.Rolled or "{player} rolled {number} with {dicecount} dice."
    Additionally, you can edit your JSON config to read
    Code:
        "Rolled": "{player} rolled {number} with {dicecount} dice."
    Output looks like
    [​IMG]
     
  18. Wulf

    Wulf Community Admin

    I think I wrote this plugin waaayy back when I first started with Lua. It's overdue for a rewrite. ;)
     
  19. Hehe. It's really nice. I totally can't make code for crap. But I can understand usually.
     
  20. Bro are you able to effectively turn this into a higher lower type game? and if so would it be hard?