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

Switch team GUI kills all players in the game?

Asked by 7 years ago

I have created a GUI where you can switch teams. I have made it where if you click on any team it kills you so you can respawn at the team spawn with the team weapons/tools for the team you chose. But when I tested this out in game via ROBLOX Player with a friend. He decided to switch teams. When he clicked the button it killed all the players in the game.

However it did make him switch teams and I was still on the team I spawned as/chose. The problem is that I just want only the person that switches teams to be killed instead of every single person in the game.

Here is a picture of the items in the GUI:

LocalScript inside TextButton:

01local TextButton = script.Parent
02local Frame = TextButton.Parent
03local player = game.Players.LocalPlayer
04 
05 
06function hover()
07    TextButton.BackgroundColor3 = Color3.fromRGB(176,176,176)
08end
09 
10 
11function hover2()
12    TextButton.BackgroundColor3 = Color3.fromRGB(226,226,226)
13end
14 
15 
View all 26 lines...

All of the other LocalScripts inside of the TextButtons are the same except the TeamColor = BrickColor.new("") is different.

Please help me, Thank you!

0
Of course it's going to kill all the players because you literally tell the script to do exactly that lol Perci1 4988 — 7y
0
...are you going to help me fix it or you just gonna sit there and be rude about it? PvPNinjaDragon 35 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Heheh, well, instead of saying

v.Character:BreakJoints()

I would say

player.Character:BreakJoints()

Ad

Answer this question