Another example of a meaningless annoying bug - Printable Version +- 2DWorlds Forums (http://2dworlds.buildism.net/forum) +-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4) +--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13) +--- Thread: Another example of a meaningless annoying bug (/showthread.php?tid=3563) |
Another example of a meaningless annoying bug - Qwertygiy - 04-18-2011 Line 3: [lua] local controller = body.VelocityController [/lua] --Some stuff Line 14: [lua] function CheckVitalSigns() [/lua] --Some stuff Lines 17-20: [lua] if controller == nil then controller = create("VelocityController") controller.Parent = body end [/lua] --More stuff, including end of CheckVitalSigns Lines 30-32: [lua]while true do sleep(0.1) CheckVitalSigns() [/lua] --Even more stuff Lines 46-48: [lua] if not controller then CheckVitalSigns() end if thedude.Position.x > body.Position.x then controller.Velocity.x = 5.0 [/lua] Output: Script:48: attempted index of non-table > RE: Another example of a meaningless annoying bug - AK-47 - 04-19-2011 controller.Velocity.x = 5.0 Have you tried "controller.Velocity = Vec2D(5.0,0)" and you can change the y-component to whatever you want. RE: Another example of a meaningless annoying bug - Qwertygiy - 04-19-2011 I'll try -- using it like this: [lua] controller.Velocity = Vec2D(5.0,controller.Velocity.y) [/lua] So that I can change the y seperately. And it worked. :doubt: Vectors are odd in Lua. RE: Another example of a meaningless annoying bug - Jacob__mybb_import1 - 04-23-2011 You can't only change the x or y components. RE: Another example of a meaningless annoying bug - AK-47 - 04-23-2011 ^^ Err, I mean change their values. |