Apparently ~~~~~~~~~~~~~~~~ local Door = script.Parent function onTouch(Door) Brick = Brick.Parent:findFirstChild("Humanoid") Parent.Torso.Texture = "http://www.roblox.com/asset/?id=2133323" if (Player ~= nil) then Player.Health = 0 end end Door.Touched:connect(onTouch) ~~~~~~~~~~~~~~~~~ it isn't working..
1 | local Door = script.Parent |
2 | function onTouch(Brick) -- the argument is the part that touches the door, not the door itself |
3 | local hum = Brick.Parent:findFirstChild( "Humanoid" ) -- i wouldn't use the variable name brick if it's already being used |
4 | if hum and Brick.Parent.Torso.roblox.Texture ~ = "http://www.roblox.com/asset/?id=2133323" then |
5 | Brick.Parent:BreakJoints() |
6 | end |
7 | end |
8 |
9 | Door.Touched:connect(onTouch) |