How do you make a door that when closed kills, but when opened allows you to pass?
I'm trying to make a laser door, but I can't figure out how to. My script won't even open the door, and the door won't even kill you. So thanks if you can help.
02 | local Brick = script.Parent |
07 | script.Parent.Transparency = . 8 |
08 | script.Parent.CanCollide = true |
10 | local function PlayerTouched(Part) |
11 | local Parent = Part.Parent |
12 | if game.Players:GetPlayerFromCharacter(Parent) then |
13 | Parent.Humanoid.Health = 0 |
22 | script.Parent.Transparency = 1 |
23 | script.Parent.CanCollide = false |
28 | if isOn = = true then off() else on() end |
32 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
Im a bit of a noob, so please go easy on me! :)