script.Parent.blade.Touched:connect(function(p) if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false p.Parent.Humanoid:TakeDamage(6) end end)
Here is the weapon I want to be anti team kill but I don't know how to make it that way. Is there anyone who show me how to add a anti-TK part to this? Cause it is so frustrating I've looked everywhere and there's no tutorials or anything on how to make a player on a team ignore damage there's only scripts that kills both players so please help me.
Worth a shot.
script.Parent.blade.Touched:connect(function(p) if script.Parent.CanDamage.Value == true then if game.Players:GetPlayerFromCharacter(p.Parent) then if game.Players:GetPlayerFromCharacter(p.Parent).TeamColor ~= game.Players.LocalPlayer.TeamColor and p.Parent ~= game.Players.LocalPlayer.Character then script.Parent.CanDamage.Value = false p.Parent.Humanoid:TakeDamage(6) end end end end)
Closed as Not Constructive by OldPalHappy
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?