I realized that the following portion of this line were outdated. :Torso.roblox.Texture" and changed it to what you see in the code now. 5 if Player.Parent.Torso.roblox.Texture == "http://www.roblox.com/asset/?id=382538058" then
i will never stop asking these questions and i will not stop learning how to code regardless.
incapaz 3669
local Door = script.Parent--I have declared the part as Door.
function onTouch(Brick)--Sets the start of our function and when triggered it gives back, the object that was hit.
local Player = Brick.Parent:findFirstChild("Humanoid")--Finds Humanoid in Brick.
if(Player~=nil)then--Checks if Player is a real Player.
if Player.Parent.Shirt.ShirtTemplate == "http://www.roblox.com/asset/?id=382538059" then
Door.CanCollide = false--Our door is no longer solid.
Door.Transparency = 0.5--Our door is now partially transparent.
Door.BrickColor = BrickColor:Random()--We have assigned a randomly color to the door.
wait(2)--Wait 2 seconds.
Door.CanCollide = true--Our door is now solid.
Door.Transparency = 0--Our door is non-transparent
Door.BrickColor = BrickColor:Random()--We have assigned another randomly generated color to our door.
else Player.Health = 0--Deny access and Kill the Character.
end
end
end
Door.Touched:connect(onTouch)--Our door is now connected the the function onTouch().

1 comment
This is not your code. Do not postcode that isn't yours. You have previously mentioned this. The comments also gave it away.