Killing Players on the Same Team

I making a team that only take damage from other team members. I got kinda stuck but here is the script.

Local Script in Team:

local team = script.Parent
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")

if player.Team == team then
	humanoid:TakeDamage(10)
end

I am a bit confused, do you want people on the same team to be able to kill each other?

--target is the tool target
if target.Team == player.Team then
	target.Character.Humanoid:TakeDamage(10)
end

You need to do damage on server scripts because Local Scripts won’t change it for everyone else.

1 Like

ok

This text will be blurred

yes and if its possible, can u show me?

On my reply above, Instead of using ~=(not equal) use ==(equal) and if you want all the players to be able to kill each other, remove the if statement completely.