This script is supposed to check if a player is on red team then if the player is on red team and touches a part then it will kill that player. but when I run the script and test it, it gives me this error: attempt to index nil with 'Team' - Server - RedTeamTouched:8
local Team = game:GetService("Teams")
local player = game.Players.LocalPlayer
local debounce = false
script.Parent.Touched:Connect(function(hit)
if player.Team.Name == "Red Team" then
if debounce == false then
debounce = true
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(100)
end
wait(1)
debounce = false
end
end
end) wait(1)
debounce = false
end
end
end)

1 comment
lol you answer all my questions