Pizzicato Posted October 22, 2019 Posted October 22, 2019 I was just playing around with a very simple script to remove a group when it reaches a certain point. It works just fine if I use either of the following: local group = ... Group.destroy(group) local group = ... group:destroy() ... but the script silently fails if I try to accomplish the same thing with a minor delay via the timer.scheduleFunction() method: local group = ... timer.scheduleFunction(Group.destroy, {group}, timer.getTime() + 5) I'm sure I'm missing something painfully obvious, but I can't figure out where/how the syntax is wrong. i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Pizzicato Posted October 22, 2019 Author Posted October 22, 2019 I also tried this (very redundant) test to see if defining the function within the script worked: local group = ... function destroyGroup( groupToDestroy ) Group.destroy( groupToDestroy) end timer.scheduleFunction(destroyGroup, {group}, timer.getTime() + 5) i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Pizzicato Posted October 22, 2019 Author Posted October 22, 2019 Never mind - I figured it out. I just needed to unpack the table passed by scheduleFunction() in order to get at the 'group' table. i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S
Recommended Posts