This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Simple scripting help
#3
@Erwin, I think you over-complicated the task there Smile

Use this if you simply want to scramble already set values for tagged objects:
Code:
math.randomseed(os.time())

objects = grp.tag('Scramble')
values = {}

for _, obj in ipairs(objects) do
  values[ #values + 1 ] = obj.value
end

for _, obj in ipairs(objects) do
  index = math.random(1, #values)
  obj:write(values[ index ])
  table.remove(values, index)
end
Reply


Messages In This Thread
Simple scripting help - by Jayce - 15.12.2021, 16:22
RE: Simple scripting help - by admin - 16.12.2021, 06:31
RE: Simple scripting help - by Jayce - 16.12.2021, 11:50
RE: Simple scripting help - by admin - 16.12.2021, 12:35

Forum Jump: