This is one without a VIP T-shirt
01 | print ( "VIP Door Script loaded" ) |
04 | permission = { "Snowballs" } |
06 | function checkOkToLetIn(name) |
07 | for i = 1 ,#permission do |
10 | if (string.upper(name) = = string.upper(permission [ i ] )) then return true end |
15 | local Door = script.Parent |
17 | function onTouched(hit) |
19 | local human = hit.Parent:findFirstChild( "Humanoid" ) |
20 | if (human ~ = nil ) then |
22 | print ( "Human touched door" ) |
24 | if (checkOkToLetIn(human.Parent.Name)) then |
25 | print ( "Human passed test" ) |
26 | Door.Transparency = 0.5 |
27 | Door.CanCollide = false |
29 | Door.CanCollide = true |
31 | else hit.Parent.Torso.CFrame = CFrame.new(Vector 3. new( 0 , 0 , 0 )) |
36 | script.Parent.Touched:connect(onTouched) |
This is one WITH a VIP T-shirt
01 | print ( "VIP T-Shirt Door Script Loaded" ) |
04 | permission = { "Snowballs" , "Test" } |
09 | function checkOkToLetIn(name) |
10 | for i = 1 ,#permission do |
13 | if (string.upper(name) = = string.upper(permission [ i ] )) then return true end |
18 | local Door = script.Parent |
20 | function onTouched(hit) |
22 | local human = hit.Parent:findFirstChild( "Humanoid" ) |
23 | if (human ~ = nil ) then |
24 | if human.Parent.Torso.roblox.Texture = = texture then |
25 | Door.Transparency = 0.7 |
26 | Door.CanCollide = false |
28 | Door.CanCollide = true |
31 | print ( "Human touched door" ) |
33 | elseif (checkOkToLetIn(human.Parent.Name)) then |
34 | print ( "Human passed test" ) |
35 | Door.Transparency = 0.7 |
36 | Door.CanCollide = false |
38 | Door.CanCollide = true |
45 | script.Parent.Touched:connect(onTouched) |
Hope this helps! (By the way, place this script INSIDE the part for the VIP door)
Closed as Not Constructive by woodengop, Shawnyg, and M39a9am3R
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?