I have made a VIP Door script in which if a person's torso is wearing a certain decal it allows them to enter a door. If they are not wearing the suitable decal the person who tries to enter the door dies. This LocalScript inside a door is not functioning at all. It doesn't kill or open the door. What are the errors in this script?
local Door = script.Parent
function onTouch(brick)
local Player = brick.Parent:findFirstChild("Humanoid")
if (Player ~= nil) then
if Player.Parent.Torso.roblox.Texture =="rbxassetid://2166863805" then
Door.CanCollide = false
Door.Transparency = 1
else
Player.Health = Player.Health - 110
end
end
end
Door.Touched:Connect(onTouch)

1 comment
Thanks!