i have no idea whats wrong with my code
local doorvar = workspace.door.door1
local doorvar2 = workspace.door.door2
local ClickDetector = workspace.door.door1.ClickDetector
if doorvar.CanCollide == true and ClickDetector.MouseClick:Connect(function() then
local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=833871080"
sound.Volume = 0.3
sound:play()
doorvar.Transparency = 1
doorvar.CanCollide = false
doorvar2.Transparency = 0
doorvar2.CanCollide = true
end
end)
if doorvar2.CanCollide == true and ClickDetector.MouseClick:Connect(function() then
local sound2 = Instance.new("Sound")
sound2.SoundId = "http://www.roblox.com/asset/?id=833871080"
sound2.Volume = 0.3
sound:play()
doorvar.Transparency = 0
doorvar.CanCollide = true
doorvar2.Transparency = 1
doorvar2.CanCollide = false
end
end)
####Please encode your code in a code block, the community will not help you with your question if you don't encode your code as it's hard to read!
Thanks, JesseSong!
