Forum

> > CS2D > Scripts > How shuffle items?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How shuffle items?

2 replies
To the start Previous 1 Next To the start

old How shuffle items?

sheeL
User Off Offline

Quote
Hello us

You can help me to shuffle some items for my new script?
Here is the list

1
2
3
4
5
item[1] = "Garra"
item[2] = "Guerra"
item[3] = "Espada"
item[4] = "Vida"
item[5] = "<<Porção de solução 250>>"
--
1
item = {"Garra",Guerra","Espada","Vida","<<Porção de solução 250"}

Thanks cookie

old Re: How shuffle items?

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
function shuffle(a)
	local b = {}
	for i = 1, #a do
		local rkey = math.random(1, #a)
		table.insert(b, rkey)
		table.remove(a, rkey)
	end
	return b
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview