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

How do I make These 2 Scripts only Functional for Players of a Group and Allies of a Group?

Asked by
SirPaco 66
9 years ago

Players of a Group Script

local Player = script.Parent.Parent.Parent.Parent.Parent
local teamcolor = "Bright green"

function onClick()
    if Player.TeamColor == BrickColor.new(teamcolor) then
    return
    else
    Player.TeamColor = BrickColor.new(teamcolor)
    Player.Character.Humanoid.Health = 0
    end
end

script.Parent.MouseButton1Down:connect(onClick)

Allies of a Group Script

local Player = script.Parent.Parent.Parent.Parent.Parent
local teamcolor = "Bright blue"

function onClick()
    if Player.TeamColor == BrickColor.new(teamcolor) then
    return
    else
    Player.TeamColor = BrickColor.new(teamcolor)
    Player.Character.Humanoid.Health = 0
    end
end

script.Parent.MouseButton1Down:connect(onClick)

Answer this question