ContextActionService could not find the function passed in, doing nothing

I noticed that the callback function you used is local. Try making it a global function.

I think this might be because of garbage collection. Once the setup function has finished execution, the function gets garbage collected by Lua, so there isn’t a reference to the function any more. But, if it ends up global, then it avoids garbage collection.