I apologize if this has been a common topic posted on the forums before, I have tried looking elsewhere and I haven’t been able to find quite what I’m looking for. I have done some sifting through my scripts and I think I have narrowed down the issue, though I do not know how to combat it.
I have a script on ServerScriptService, titled “chat-handler”, that runs a function from a module script in the same parent location titled “command-archive”. The function within command-archive does a variety of things as it’s handling multiple different types of string inputs, but the main thing I am focused on is when the command-archive module script invokes a BindableFunction titled “time-redirector” (which is again, in the same place as all these other scripts I have mentioned, ServerScriptService). There is another script in ServerScriptService titled “time-handler” that is supposed to be acting upon this bindable function being invoked, and the problem I am having is that half of the time I am not getting any response whatsoever from this script and half of the time I am (with the same input values being processed for each invoke). It’s very unpredictable, and I’m not quite sure what could be causing this issue because there isn’t much being done in between the invokes.
While I am relatively new to working with Roblox scripting I’ve been using the API documentation for virtually everything I work on just to make sure I am doing it right, so I’m not sure if I’ve been majorly misinformed or not. Here are the few lines of code that I have narrowed down to being a part of the issue:
(line of code on chat-handler server script calling module function) :
commandarchive.runcommand(player, messagecache) --message cache is just your standard string value.
(line of code on command-archive module script that invokes the time-redirector bindable function):
local invokercache = "chat.invoker"
local packetcache = flagscache[2] * 60 --this value will always be a number value, type checking is done earlier on in the module script.
timeredirector:Invoke(invokercache, packetcache)
(line of code on time-handler that is acting upon the time-redirector bindable function being invoked).
timeredirector.OnInvoke = (function(invokercache, packetcache)
print(1)
if invokercache == "chat.invoker" then
timestatic = packetcache --timestatic is just a generic local variable, and it should not be the root of the issue as far as I can tell.
end
end)
Anyone have any suggestions as to what the issue could be? Am I just terrible at coding and not understanding something extremely basic?