So, I've got this script in the 'Door' Union in a model. In the same model we have 2 Unions named 'Button1' and 'Button2' These 2 Button Unions both have ClickDetector In them. Can someone please fix this script to make the door open. Thank you.
local KCA = script.Parent.Parent.SoundPart["KeyCard Accepted"]
local KCD = script.Parent.Parent.SoundPart["KeyCard Denied"]
local DO = script.Parent.Parent.SoundPart.DoorOpen
local DC = script.Parent.Parent.SoundPart.DoorClose
local door = script.Parent
local bool = true
local bool2 = true
function openDoor()
KCA:Play()
KCD:Stop()
DO:Play()
script.Parent.Parent["Light 1"].BrickColor=BrickColor.Green()
script.Parent.Parent["Light 2"].BrickColor=BrickColor.Green()
for i = 1,(door.Size.z / 0.30) do
wait()
door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.30)
endhttps://assetgame.roblox.com/asset/?id=182529039#assetTypeId=10Military Canvas Tent image
wait(3)
DC:Play()
for i = 1,(door.Size.z / 0.30) do
wait()
door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.30)
end
script.Parent.Parent["Light 1"].BrickColor=BrickColor.Red()
script.Parent.Parent["Light 2"].BrickColor=BrickColor.Red()
end
script.Parent.workspace.Door["Button1"].ClickDetector.MouseClick:connect(function()
if bool then
bool = false
openDoor()
wait(1)
bool = true
end
end)
script.Parent.workspace.Door["Button2"].ClickDetector.MouseClick:connect(function()
if bool then
bool = false
openDoor()
wait(1)
bool = true
end
end)

3 comments
Is there anything in the output
Is there anything in the output
Yes, errors are important to fixing the script. Please show us some.