Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you script a staff only door for cafes?

2 answers

If there is a team called Staff, you can just do something like this in a script inside the door:

local debounce = true
script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr and plr.Team == game:GetService("Teams").Staff and debounce then
		debounce = false
		script.Parent.CanCollide = false
		script.Parent.Transparency = 0.5
		wait(1)
		script.Parent.CanCollide = true
		script.Parent.Transparency = 0
		debounce = true
	end
end)

The wiki goes into much more detail in the page Shawnyg provided, but if you wanted to make the door more secure you could look into the wiki page that I believe is called Collision Filtering (I would send a link but my internet is dead)

Are you serious? I find it hard to believe that she tried "everything". When I was a terrible scripters, I free modeled rank doors and I was FINE. And, I'm very sorry but we don't make free scripts for you. There's a reason why this website is "Scripting Helpers" and not "We make free scripts for you!". Try again, and come back when you have an actual line of code you need help with. I'm not your free developer, we all aren't. Make an effort.

R U FRIGGING SERIUS

This discussion is preserved as it was. New answers, comments, and votes are closed.