Kill all players and then change their team script?
So I've been trying to get this to work all day. I am seething with rage right now. I am ready to launch my game, but cannot because of this. I need it to work once a brick is clicked. I made the part, put the click detector in it, and this is the bit of the script I already have:
1 | function ClickTime(Plyr) |
2 | for i,v in pairs (Players:GetPlayers()) do |
3 | v.Character:BreakJoints() |
6 | script.Parent.ClickDetector.MouseClick:connect(ClickTime) |
However, that didn't work, and It didn't change the teams(Because I still don't know how to do that). So then I tried this:
1 | local detect = script.Parent.ClickDetector |
4 | for i, v in pairs (game.Players:getPlayers()) do |
5 | v.Character:breakJoints() |
8 | detect.MouseClick:connect(kill) |
And that didn't work either. If someone can help me make these scripts kill all, that would be great. And if you need to know the teams, they are: "Really red" "Bright blue" "Bright yellow" And I am trying to change the teams to yellow.