I want to stop Team kill With My sword script, but I can't figure out how to alter my code to check if who I'm hitting is on the same team or not as the person who hits them because it is a different than other Anti team kill scripts, I read that revolve around Humanoid.Health then what I Used TakeDamage().
Here is the Script.
Handle.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent ~= Tool.Parent then
if Debounce == true and PlayersHit[Hit.Parent] == nil then
Hit.Parent:FindFirstChild("Humanoid"):TakeDamage(math.random(15,35))
PlayersHit[Hit.Parent] = true
wait(1)
PlayersHit[Hit.Parent] = nil
end
end
end)

4 comments
Did it work?
I guess It works
I dunno, haven't used the script yet
Those variables would not work with my script i think