I need help my Changing Lua Code to C# for Unity to for a pack opening simulation

Keywords: c# lua

Question: 

I am trying to convert my Lua script to C# for unity, I need help to do that.

I have Tried to learn c# to convert it but do not understand C# very well.

PackOpening = function(x) local r = math.random(1,261) return x[r] end

IconsPack = {"Pele 99 Rated","Ronaldo 97 Rated","Ronaldo 96 Rated","Cruyff 95 Rated","Pele 95 Rated","Ronaldinho 95 Rated","Eusebio 94 Rated","Cruyff 94 Rated","Best 94 Rated","Henry 94 Rated","Ronaldinho 94 Rated","Ronaldo 94 Rated","Van Basten 94 Rated","Lineker 93 Rated","Luis Figo 93 Rated","Eusebio 93 Rated","Best 93 Rated","Gullit 93 Rated","Henry 93 Rated","Van Basten 93 Rated","Del Piero 93 Rated","Van Nistelrooy 93 Rated","Lineker 92 Rated","Rivaldo 92 Rated","Raul 92 Rated","Luis Figo 92 Rated","Stoichkov 92 Rated","Del Piero 92 Rated","Bergkamp 92 Rated","Butragueno 92 Rated","Kluivert 92 Rated","Van Nistelrooy 92 Rated","Shearer 92 Rated","Inzaghi 91 Rated","Kluivert 91 Rated","Cruyff 91 Rated","Micheal Owen 91 Rated","Eusebio 91 Rated","Pele 91 Rated","Shearer 91 Rated","Shevchenko 91 Rated","Van Basten 91 Rated","Hernandez 91 Rated","Klose 91 Rated","Trezeguet 91 Rated","Luis Figo 90 Rated","Best 90 Rated","Henry 90 Rated","Hernandez 90 Rated","Inzaghi 90 Rated","Larsson 90 Rated","Zola 90 Rated","Rivaldo 90 Rated","Ronaldo 90 Rated","Butragueno 90 Rated","Van Nistelrooy","Lineker 89 Rated","Baggio 89 Rated","Laudrup 89 Rated","Cruyff 89 Rated","Eusebio 89 Rated","Shearer 89 Rated","Van Basten 89 Rated","Klose 89 Rated"} print(PackOpening(IconsPack))

I expect that the math.random function might not work but please try

Answers: