I am trying to make a capturing mechanic to kill a player when a different team clicks on them. I have tried multiple times to make the script. Am I doing something wrong? Please let me know! (The click detector is in the Torso)
function onClicked(player)
a = game:GetService("Players"):GetPlayerFromCharacter(onClicked.Parent)
if (a) then
if (a.TeamColor == BrickColor.new("Really blue")) then
script.Parent.Parent.Parent.Humanoid.Health = 0
end
end
end
script.Parent.MouseClick:connect(onClicked)

1 comment
Thank you so much! You are a true helper! I was scrambling to find an answer and this surly helped!