Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I am struggling to make an anti-TK weapon can anyone help? [closed]

Asked by 6 years ago
Edited 6 years ago
  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.

0
You should show what you've tried, places you've looked, and what exactly you don't understand. Asking how to do things without having tried to do the thing isn't constructive. OldPalHappy 1477 — 6y

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?

1 answer

Log in to vote
-1
Answered by 6 years ago

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)
0
Explain your answers. OldPalHappy 1477 — 6y
Ad