Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you script a staff only door for cafes?

Asked by 6 years ago

My friend needs help with this. She's tried youtube videos, free models, everything! Please help us!

0
Its not hard, there are youtube videos. 1freshkidz1 12 — 6y

2 answers

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

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)

Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question