I want to make a door for a place that disappears when you touch it, but comes back after 5 seconds.
Script must be inside door
function onTouched(part) if part.Parent:findFirstChild("Humanoid") then script.Disabled = true script.Parent.Transparency = 1 script.Parent.CanCollide = false wait(5) script.Disabled = false script.Parent.Transparency = 0 script.Parent.CanCollide = true end end script.Parent.Touched:connect(onTouched)
function onTouch(hit) if hit.Parent then if hit.Parent:FindFirstChild('Humanoid') then script.Parent.Transparency = 1 script.Parent.CanCollide = false wait(5) script.Parent.Transparency = 0 script.Parent.CanCollide = true end end end script.Parent.Touched:connect(onTouch)
function onTouched(part) if part.Parent:findFirstChild("Humanoid") then script.Parent.Transparency = 1 script.Parent.CanCollide = false --I would use Vector3.new() becuase it will slide away and not become invisible wait(5) script.Parent.Transparency = 0 script.Parent.CanCollide = true end end script.Parent.Touched:connect(onTouched)
Vector3.new(98,878,90909) will make it look a bit better, Ether way its your door or whatever you are making.
function onTouch(hit) if hit.Parent then if hit.Parent:FindFirstChild('Humanoid') then script.Parent.Transparency = 1 wait(5) end end end script.Parent.Touched:connect(onTouch)