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.
local isOn = true
local Brick = script.Parent
local kill = true
function on()
isOn = true
script.Parent.Transparency = .8
script.Parent.CanCollide = true
if kill == true then
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = 0
end
end
end
function off()
isOn = false
kill = false
if kill == false then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
end
function onClicked()
if isOn == true then off() else on() end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
on()
Im a bit of a noob, so please go easy on me! :)

2 comments
It isn't a vip door...
I know but if you copy certain scripts but ignore the scripts that say VIP you can make this door