wh1sp3r Posted February 7, 2010 Share Posted February 7, 2010 I need a little help with lua I am trying to use lua without class, just require("Scripts/core") function CreateModel(model) model.light=CreateSpotLight(100) end function Update(model) model.light:Movef(0,1,0) end or require("Scripts/core") light=CreateSpotLight(100) function Update() light:Movef(0,1,0) end Class is a little bit messy in this way, i would like to use lua without it just like that i hope , It's possible ? Quote -= Phenom II X4 965 3.4Ghz - ATI HD5870 - 6 GB DDR3 RAM - Windows 8 Pro 64x=- Website: http://www.flamewarestudios.com Link to comment Share on other sites More sharing options...
Paul Thomas Posted February 8, 2010 Share Posted February 8, 2010 Just taking a shot, I think it would be like; function Lights() local light = {} light.spot = CreateSpotLight(100) function light:Update() light:Movef(0,1,0) end return light end lights = Lights() lights:Update() I'm still new to Lua but that's what I've gathered in my day of learning by trial and error. If you mean to automatically update then maybe you'd make it an added hook? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.