Home › Forums › General › Programming › General Programming/Lua question › Reply To: General Programming/Lua question
October 29, 2020 at 3:28 pm
#120469
In the lua editor, Right click on the lua cube and create a function by clicking on Add Method.
Then you can access that function globally and call it from multiple parts of your panel.
------global------function
myRandom = function()
return (math.random(0, 512))
end
------global------function
a = function()
local b = myRandom()
return b + b
end
b = function(n)
if n == true then
return myRandom()
end
end
console(tostring(a()))
console("" .. b(true))
console(tostring(myRandom()))
Regards,
- This reply was modified 3 years, 6 months ago by dnaldoog.