You can write your topic however you want, but you need to answer these questions:
What is the issue? I keep dying randomly for no reason and also this happens to other people
What solutions have you tried so far? I did look over everything in the dev forum no luck though.
game.Players.PlayerAdded:Connect(function(plr)
for _, v in game.Workspace.ExampleFolder:GetChildren() do
if v:IsA("Part") then
v.Touched:Connect(function()
if plr.Team == game.Teams.Example2 then
plr.Character.Humanoid.Health = 0
end
end)
end
end
end)
And also, Yes my team was not example2 and I did not touch the part.
This works just fine for me (improved your script):
for _, v in workspace:WaitForChild("ExampleFolder"):GetChildren() do
if not v:IsA("Part") then continue end
v.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr and plr.Team == game:GetService("Teams").Example2 then
plr.Character.Humanoid.Health = 0
end
end)
end
If this doesn’t work for you then another script must be killing your player constantly.