Hey, I created a VIP t-shirt and a door that opens when you have the t-shirt put on. But it doesn't work, I've done everything correctly for my feeling and I did subtract 1 in the URL, so I don't know what I am doing wrong, in the output it says Workspace.Part.Script:4: attempt to index field 'Parent'(a nil value)
local Door = script.Parent
function onTouch(Brick)
local Player = Brick.Parent:findFirstChild("Humanoid")
if (Player ~= nil) then
if Player.Parent.Torso.roblox.Texture == "http://www.roblox.com/asset/?version=1&id=1303165260" then
Door.CanCollide = false
Door.Transparency = 0.5
Door.BrickColor = BrickColor:Random()
wait(2)
Door.CanCollide = true
Door.Transparency = 0
Door.BrickColor = BrickColor:Random()
else Player.Health = 0
end
end
end
Door.Touched:connect(onTouch)
Not subtracting 1 in the URL doesn't work either
