Hello scripters! I have a little problem. So i have 4 buttons for each team. Each button has 2 scripts inside them, who are ran on same time. First script kills player once button is pressed, and it works fine, but the second script is supposed to check is the player in certain rank in my group and then switch he's team if he is. The second script is not working. Ill post below the 2 scripts, maybe they are not compatible with each other.
Kill script:
function onButtonClicked()
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
Team change script:
function Click(mouse)
if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(268422)
print ("IS IN A GROUP!")
if player:GetRoleInGroup(268422) == "Marked" then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright green")
end
script.Parent.MouseButton1Down:connect(Click)

2 comments
Great now the button doesn't work at all. I dont understand. Here are so many pro scripters and good scripters, but nobody is able to help me get one script working?
I just started scripting this summer, or was it last? I have such a bad memory that I shouldn't try helping,