- What do you want to achieve? Keep it simple and clear!
If player touches part and player is not in team then kill player
- What is the issue? Include screenshots / videos if possible!
My script isn’t working. It just doesn’t kill that player
Here is my script:
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player.Team.Name == game:GetService("Teams").General then
elseif player.Team.Name == game:GetService("Teams").Soldier then
hit.Parent:WaitForChild("Humanoid").Health = 0
end
end
end)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to look on forum but I didn’t solution for it.