You basically sort of invent modding in a way.
Build a base system that is meant to work across all places and have a variable that determines what kind of place it loads scripts according to it that communicate with base scripts (share function calls in some public modulescript or use my tutorial if you want to add community-made content: Modding in your expirience! (And game script communication))
Combine that with package links to ensure all places have the base script, and it should work.
You could also do it the more hacky way and implement it all in one place as well and insert scripts through InsertService or MainModule (MainModule is for game scripts only).