diff --git a/modules/states/playstate.lua b/modules/states/playstate.lua index a6c88c0..f19cdac 100644 --- a/modules/states/playstate.lua +++ b/modules/states/playstate.lua @@ -416,17 +416,6 @@ local function state(songName, songDifficulty) modules[#modules+1] = stageModule end - for i, func in next, stageModule do - setfenv(func, { - characters=characters, - step=step, - beat=beat, - volume=volume, - ratings=ratings,, - keyBinds=keyBinds - }) - end - if stageModule and stageModule.onCreate then stageModule.onCreate(chart.song) end @@ -449,7 +438,6 @@ local function state(songName, songDifficulty) characters.dad:PlayAnimation("idle") end - conductor.stepCrochet = conductor:calculateCrochet(chart.bpm)/4 for i = 0, 3 do @@ -509,6 +497,19 @@ local function state(songName, songDifficulty) keyBinds = settings.Keybinds state.loaded = true + + for i, func in next, stageModule do + local newEnv = getfenv(func) + newEnv.game = { + characters=characters, + step=step, + beat=beat, + volume=volume, + ratings=ratings, + keyBinds=keyBinds + } + setfenv(func, newEnv) + end end function state.finish() diff --git a/stages/limo.lua b/stages/limo.lua index dfdd74e..c88547d 100644 --- a/stages/limo.lua +++ b/stages/limo.lua @@ -55,6 +55,7 @@ return { dancer.allowedFrame = 1 dancer:PlayAnimation("bg dancer sketch PINK", 24, false) end + end end } \ No newline at end of file