diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 1b5bf86c9..506678395 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1365,7 +1365,27 @@ class PlayState extends MusicBeatState switch(event.name) { case "HScript Call": - scripts.call(event.params[0], event.params[1].split(',')); + var scriptPacks:Array = [scripts, stateScripts]; + for (strLine in strumLines.members) for (char in strLine.characters) scriptPacks.push(char.scripts); + var args:Array = event.params[1].split(','); + + for (pack in scriptPacks) { + pack.call(event.params[0], args); + //public functions + if (pack.publicVariables.exists(event.params[0])) { + var func = pack.publicVariables.get(event.params[0]); + if (func != null && Reflect.isFunction(func)) + Reflect.callMethod(null, func, args); + } + } + + //static functions + if (Script.staticVariables.exists(event.params[0])) { + var func = Script.staticVariables.get(event.params[0]); + if (func != null && Reflect.isFunction(func)) + Reflect.callMethod(null, func, args); + } + case "Camera Movement": curCameraTarget = event.params[0]; case "Add Camera Zoom":