Hi, i’m trying to calla a math.random between a group of functions but i can’t.
What i basically have is:
[lua]local function f1()
for i = 1,2 do
x
end
local function f2()
for i = 3,4 do
y
end[/lua]
I tried grouping the functions like this:
[lua]local funcs {
func1 = f1
func2 = f2
}
–to get this working
local function randomm()
math.random(funcs[1],funcs[2]
end
randomm()[/lua]
But it simply doesn’t work. I’ve minimized the code to make it easier to check.
Basically i want to make some functions and then, in other function, get a random one if x condition is true.
I’d appreciate any help.
Thanks [import]uid: 108461 topic_id: 34903 reply_id: 334903[/import]
[import]uid: 41884 topic_id: 34903 reply_id: 139003[/import]