local DebounceCreator = {} local ParameterRequest = require(game.ServerStorage.Parameter) DebounceCreator.Debounce = function(waitTime, f, argument) local executing = false return function() if not executing then executing = true if next(argument) ~= nil then argument = ParameterRequest:new(argument) f(argument:unpack()) else f() end wait(waitTime) executing = false end end end
No need to know what ParameterRequest does I think, I'm getting an error at
if next(argument) ~= nil then argument = ParameterRequest:new(argument) f(argument:unpack()) else f() end
however if I change it to:
if next(argument) ~= nil then foo = ParameterRequest:new(argument) f(parameter:unpack()) else f() end
For some reason changing the name of 'argument' to 'foo' makes the code work all of a sudden. Why is this so?