im making a prison game, and the team "Staff" should be the only ones to open the door, however when i try this script it will not work, i am quite new to scripting so any explanations about what i did wrong will help lots aswell!
Other info = script.parent is a union Staff is correctly capitalized.
local ClickDetector = script.Parent.ClickDetector
local Team = game:GetService("Teams")
local Players = game:GetService("Players")
ClickDetector.MouseClick:Connect(function(player)
if player.Team == "Staff" then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(2)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end)
