So basically, what I have been trying to do, was make a gate that only Security Guards could go through and not prisoners. How could I make it like that? Help would be appreciated.
Use the GetPlayerFromCharacter, then use Player.Team to check if they are on security guards.
function onTouch(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player.Team == “Security Guards” then --Door opening script here elseif player.Team == “Prisoners” then print(“Prisoner attempted to go through sliding door”) end script.Parent.Touched:connect(onTouch)