So I want to try and mix up this gun set, but for some reason, this version I made has changed and I can no longer kill anybody, I beleive this is the cause, but have 0 clue how to fix it, any help?
local module = {}
module.CanDamage = function(obj, player)
if obj:FindFirstChild("Humanoid") then
local p = game.Players:GetPlayerFromCharacter(obj)
local creator = obj:FindFirstChild("Creator")
if creator then
p = creator.Value
end
if p then
if p == player then
return false
else
if p.Neutral or player.Neutral then
return true
elseif p.TeamColor ~= player.TeamColor then
return true
end
end
else
return true
end
end
return false
end
return module
I suggest adding prints to the code so you can see what is and what isn’t running. Not much can be done unless you know where your code is getting to.