Ok This is a part of my script it suppose to kick players when they got head shot. but something seems to be a prob.
if Hit and Hit.Parent:FindFirstChild("Humanoid") then local Hit_Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Settings.AntiTK and not Hit_Player.Neutral and Hit_Player.TeamColor == Player.TeamColor then return end local Humanoid = Hit.Parent.Humanoid local c = Instance.new("ObjectValue") c.Name = "creator" c.Value = Player game.Debris:AddItem(c, 3) c.Parent = Humanoid if Hit.Name == "Head" then Humanoid.remove() else Humanoid.Health = Humanoid.Health - math.random(Settings.Damage[1], Settings.Damage[2]) end
if Hit and Hit.Parent:FindFirstChild("Humanoid") then local Hit_Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Settings.AntiTK and not Hit_Player.Neutral and Hit_Player.TeamColor == Player.TeamColor then return end local Humanoid = Hit.Parent.Humanoid local c = Instance.new("ObjectValue") c.Name = "creator" c.Value = Player game.Debris:AddItem(c, 3) c.Parent = Humanoid if hit.Parent.Name == "Head" then Humanoid:Destroy() else Humanoid.Health = Humanoid.Health - math.random(Settings.Damage[1], Settings.Damage[2]) end end
You Could Add A Value To the Sepperate teams, then when the part is hit check for that value then you could do
if hit.Parent.Name == "Head" then hit.Parent.Parent:Destroy()
Hope this helps!~