Ad
Log in to vote
0

How to make anti- same team killing?

Asked by 7 days ago

Example: You have a friend with you on the same team but you can still kill him.

I want to make it so you can't kill other people same team as you, how do I script it?

0
So if you have a sword or something to kill players you need to check if the player is in the same team as the player who damages the other player then it does the damage if the player is not in the same player as the player who damages them. acediamondn123 73 — 7d

1 answer

Log in to vote
0
Answered by 6 days ago

if you look in the classic roblox sword, in function blow or something, theres a line thats like

if team then -- checks if same team (i dont have the script out and just putting 'if team' doesnt check the team. adjust to how you get your teams.)
    return -- stops script
end

you could put something like that right before the dmg part of your script.

Ad

Answer this question