Murder gamemode error forcenextmurderer

Hi, my server is in murder gamemode and when I want to force someone to be the next murderer in a shop script (when he buy the item “Be next murderer”, he becomes the murderer next round). I use


RunConsoleCommand( "mu_forcenextmurderer", ply:EntIndex() )

, but I get an error in console :


[ERROR] lua/includes/extensions/table.lua:150: bad argument #1 to 'pairs' (table expected, got nil)
1. pairs - [C]:-1
 2. Count - lua/includes/extensions/table.lua:150
  3. Random - lua/includes/extensions/table.lua:159
   4. func - addons/mistforums/lua/mistforums/mist_pay/sv_mistpay.lua:111
    5. unknown - lua/includes/extensions/net.lua:32 

I’ve print ply:EntIndex(), it return me 1 so it’s ok.

I hope you can help me :smile:

Sorry for my bad english, I hope you’ve understood everything ^^
Thanks.

The error is unrelated to your code and seems to be coming from your MistForums addon.

Thanks for the reply,
that’s what I thought, the line 111 of the sv_mistpay.lua is :


ply:ConCommand( "say "..table.Random(MistPay.command) )

I think there is a problem with the table.Radom but I don’t know what :confused:

MistPay.command must not be defined.

You were right, MistPay.command was poorly defined. I fix it but now


RunConsoleCommand( "mu_forcenextmurderer", ply:EntIndex() )

has no effect, no error in console and not the expected result :frowning:

But thanks for your help :goodjob:

Someone has an idea why ? :cry: