When I tested my game, and pressed the bind to activate combat, all that happened was: ServerScriptService.Stuff.StunningHandler:14: attempt to index nil with Instance
local Stunning = require(script:WaitForChild(“Stunning”))
local StunningHandler = {}
function StunningHandler.addTo(Player,Action)
Stunning[Action][Player] = true
end
function StunningHandler.removeFrom(Player,Action)
Stunning[Action][Player] = nil
end
function StunningHandler.findPlayer(Player,Action)
return Stunning[Action][Player]
end
It seems to be an error to do with you trying to access an “item” in a module script which doesn’t exist. If you are trying to access an item in a table, I suggest debugging it first with a simple print.
local Stunning = require(script:WaitForChild(“Stunning”))
local StunningHandler = {}
function StunningHandler.addTo(Player,Action)
print(Stunning[Action])
print(Stunning[Action][Player])
Stunning[Action][Player] = true
end
function StunningHandler.removeFrom(Player,Action)
print(Stunning[Action])
print(Stunning[Action][Player])
Stunning[Action][Player] = nil
end
function StunningHandler.findPlayer(Player,Action)
print(Stunning[Action])
print(Stunning[Action][Player])
return Stunning[Action][Player]
end
return StunningHandler
If the first print fails that means “Stunning” doesn’t exist. From there you can take more actions to fix this.