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! :)
There is a tutorial for a VIP door that may work without VIP. http://wiki.roblox.com/index.php?title=Restricted_door