#my door opening script doesnt work
24 messages · Page 1 of 1 (latest)
local clickPart = script.Parent.clickPart
local clickDetector = clickPart.ClickDetector
clickDetector.MouseClick:Connect(function(plr)
print(plr.Name.." has touched the door!")
if clickPart:GetAttribute("isOpen") then
for i, part in pairs(clickPart:GetChildren()) do
if part:ISA("BasePart") then
part.CanCollide = true
if part.Name == "Glass" then
part.Transparency= 0.5
else
part.Transparency = 0
end
end
end
else
for i, part in pairs(clickPart:GetChildren()) do
if part:ISA("BasePart") then
part.CanCollide = false
if part.Name == "Glass" then
part.Transparency= 0.75
else
part.Transparency = .5
end
end
end
end
clickPart:SetAttribute("isOpen", not clickPart:GetAttribute("isOpen"))
end)
also how can i make it so that when you open or close the door it makes a sound
So like you want
if we click on the door it should
open
right?
@austere jewel
how long you have been scripting tho ?
ive been trying to fix this for 20 min