My friend made this door a while ago and we still use it. he ended up quitting roblox and gave me his models but i cant figure out how to make it that it goes to the side instead of opening in a opening like a normal door but have no idea how to edit the script like that. Any possible way to do it where it goes to the side instead?
local Model = script.Parent local Handler = Model:WaitForChild("Handler") local Knob = Model:WaitForChild("Knob") local ClickDetector = Knob:WaitForChild("ClickDetector") local AngleIncrement = 10 --change this to whatever you want, its how fast the door swings open/close local WhitelistGroupIds = {} local Open = false function OpenDoor() for i=1, 360 / 4, AngleIncrement do for _,v in pairs(Model:GetChildren()) do if v:IsA("BasePart") then v.CFrame = (Handler.CFrame * CFrame.Angles(0, math.rad(AngleIncrement), 0)) * Handler.CFrame:toObjectSpace(v.CFrame) end end wait() end Open = true end function CloseDoor() for i=360 / 4, 1, -AngleIncrement do for _,v in pairs(Model:GetChildren()) do if v:IsA("BasePart") then v.CFrame = (Handler.CFrame * CFrame.Angles(0, math.rad(-AngleIncrement), 0)) * Handler.CFrame:toObjectSpace(v.CFrame) end end wait() end Open = false end function OpenCloseDoor() if not Open then OpenDoor() else CloseDoor() end end local debounce = false ClickDetector.MouseClick:connect(function(plr) if debounce then return end debounce = true if #WhitelistGroupIds > 0 then for i=1, #WhitelistGroupIds do if plr:IsInGroup(WhitelistGroupIds[i]) then OpenCloseDoor() end end else OpenCloseDoor() end debounce = false end)
Dude, no point in editing this script, you HAVE to remake it from start. This script is all about turning the door at an angle. You would have to delete everything.
Look into part tweening for sliding doors : https://www.youtube.com/watch?v=qgGDwTn0zgo