Hi, community! For the projects (scenarios, specifically) that demand it, I've been using this snippet of code for slow motion: Code: helper.queueLuaCommandByName('scenario_player0', 'bullettime.set(1.8)') However, a recent test I've done has hit a snag. I can't seem to set the slow motion with a variable: Code: helper.queueLuaCommandByName('scenario_player0', 'bullettime.set(sloMo)') A quick look inside bullettime.lua indicates that the set() function specifically weeds out any inputs except raw numbers. But surely my variable, effectively being a number, ought to suffice, right?
The issue here is, that you are not sending the value of your variable over. Your variable only exists in the scope it is defined in and in this case it's at maximum GE lua. The bullettime code is executed in vehicle lua though, so there is absolutely no chance this could work as is. The fix however is easy, you just need to make it send the actual value instead of trying to use a reference. Code: helper.queueLuaCommandByName('scenario_player0', 'bullettime.set('..tostring(sloMo)..')') Is what you are actually looking for