I want to know how I would properly make it so it only lets a player in not a team.
local team = game.Teams.Blue local door = script.Parent door.Touched:connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr.Team == team then door.CanCollide = false door.Transparency = .5 wait(1) door.CanCollide = true door.Transparency = 0 else humanoid.Health = 0 end end end)
Simple. Instead of checking if the player's team equals something, check their name or their userid: if plr.Name == "GarrettlovesGTA" then
.
You would use it in your code like this:
local door = script.Parent door.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr.Name == "GarrettlovesGTA" then --here, see? door.CanCollide = false door.Transparency = .5 wait(1) door.CanCollide = true door.Transparency = 0 else humanoid.Health = 0 end end end)
(Btw use :Connect()
rather than :connect()
)