I feel this will be useful, for my future builds and my current ones, especially. I am intrigued by this idea, and if somebody were to answer I would be ever so grateful. I know how to make a button door, however, I don't know how to limit it to a certain team. I have tried combining button doors and team doors, but I haven't quite made the right transition.
COMMUNITY QUESTION
How do you make a team only button door? - Drxift
1 answer
local Part = script.Parent
local TeamRestriction = "Pirates"
local function onTouch(Hit)
if Hit.Parent:FindFirstChildWhichIsA("Humanoid") then -- Make sure it is a player
local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent) -- Use a special method named GetPlayerFromCharacter, which you get a player from the players model in workspace
if Player.Team == TeamRestriction then -- Check for his team
-- What to do if the players team matches "Pirate"
end
end
end
Part.Touched:Connect(onTouch) — Assign connect function to onTouch
i did this on phone, so some symbols may be wrong; this is to show use of GetPlayerFromCharacter, if your not looking for this, there’s a extra parameter to the MouseClick event from the ClickDetector object, the 1st parameter is what player pressed it, for example: ClickDetector.MouseClick:Connect(function(Player) end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
This place is for helping with your scripts, we don't give you scripts, if you have a problem, something you don't understand, but if you're asking us to do things for you that's against the rules, please learn scripting before starting some stuff.
I said in the description that I had already tried a script...
then show the script