Prevent Scripts Picking Teammates for damage?
There are two teams labeled Red Team
and Blue Team
respectively. How would i make this script not hurt anyone on the same team as the one who clicked on it?
01 | player = game.Players.LocalPlayer |
03 | script.Parent.MouseButton 1 Down:connect( function () |
04 | if game.Players.NumPlayers > 0 then |
05 | local player = math.random( 1 , game.Players.NumPlayers); |
06 | local Players = game.Players:GetPlayers() |
07 | local selected = (Players [ player ] ) |
08 | script.Parent.Text = selected.Name |
09 | selected.Character.Humanoid.Health = selected.Character.Humanoid.Health/ 2 |
10 | local torso = selected.Character.Torso |
11 | local i = Instance.new( 'Fire' ) |
13 | i.Color = Color 3. new( 0 , 90 , 236 ) |
14 | i.SecondaryColor = Color 3. new( 0 , 90 , 236 ) |