If anyone knows any leads, videos, or articles that could help me I would really appreciate if you could direct me towards them. Any help is appreciated and thank you.
You would have to count the kills as a number value, variable or something. Then when it passes a set amount you kick them with:
1 | player:Kick( "Text here if you want to" ) |
It's hard to tell you exactly what to do, as you have not given us any scripts. Do your game use any weapons? If your game has like guns or something you could check when the gun kills someone if it's a team member, if it is you raise the value.
This is just a very crude way of putting it but here we go:
1 | --If you want to access the player, use a local script |
2 | local kills = 0 |
3 | local plr = game.Players.LocalPlayer |
4 |
5 | repeat wait() until kills > 5 |
6 | if kills > 5 then |
7 | plr:Kick( "Too many kills" ) |
8 | end |
I would save TK's as another variable, and if that variable exceeds the limit, then
1 | player:Kick( "Too many teamkills!" ) |
If you're making say a melee weapon like a knife then you could;
01 | local tool = script.Parent |
02 | local myPlr = game.Players:GetPlayerFromCharacter(tool.Parent) |
03 | local TKs = 0 |
04 | Handle.Touched:Connect( function (hit) |
05 | if hit.Parent:FindFirstChild("Humanoid) and attacking then |
06 | local char = hit.Parent |
07 | local player = game.Players:GetPlayerFromCharacter(char) |
08 | hit.Parent.Humanoid:TakeDamage(damage here) --Change damage here to a number |
09 | if hit.Parent.Humanoid.Health = 0 and myPlr.Team = = player.Team then |
10 | TKs = TKs + 1 |
11 | if TKs > = teamkill_limit then --Change teamkill_limit to a number |
12 | myPlr:Kick( "Too many teamkils!" ) |
I didn't define teamkill_limit as I don't know what you want it to be, same with 'damage here'