Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lua - tables and functions - Help!

Started by brasslips2 Mar 15, 2009 at 5:50 PM 0 replies 700+ views
Original Post
brasslips2
brasslips2
hello, I'm trying to call functions via lua tables like the following: func1 = function() .. end func2 = function() .. end func3 = function() .. end funcs = {[0] = func1, [1] = func2, [2] = func3} -- in my main function I then call it from inside a loop like so... for i = 0, 2, 1 do funcs() end I keep getting an error saying I'm calling a nil value from funcs() I've tried multiple ways to do this but I can't seem to figure this out. Can someone help me out with this?
brasslips2
brasslips2
Nevermind I figured out a way to do this. Thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.