I wanna make a weapon that can pierce forcefield.
function TakeDamage(humanoid, Damage)
if not humanoid or not humanoid:IsA("Humanoid") or not Damage or not Player then
return
end
local character = humanoid.Parent
for i, v in pairs(character:GetChildren()) do
if v:IsA("ForceField") then
return
end
end
local player = Players:GetPlayerFromCharacter(Character)
if player then
if IsTeamMate(Player, player) then
return
end
CurrentMana.Value = CurrentMana.Value + (CurrentMana.MaxValue * 0.02)
end
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
UntagHumanoid(humanoid)
end

1 comment
May I suggest you just disable forcefields?