Hi, I've tried to make a "Surface Blast Doors", but my script everytimes make the doors open BUT not open. I use CFrame Lerp and it makes that like the doors are open and not moving, but for roblox it moves, it moves only like a 0.001 stud and I don't know how to fix it. Please help. There is my script.
local db = false
local open = false
script.Parent.ClickDetector.MouseClick:Connect(function()
warn("Checking if SBD's are open..")
if open == false then
warn("SBD's closed, checking if in move!")
if db == false then
warn("SBD's not moving. Opening SBD's!")
db = true
local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
for i = 0,1,.00001 do
local cfm = script.Parent.Parent.PrimaryPart.CFrame:Lerp(finish,i)
script.Parent.Parent:SetPrimaryPartCFrame(cfm)
wait()
end
open = true
warn("\nSBD's SUCCESSFULLY OPENED!")
wait(1)
db = false
warn("\nPrepared to close!")
end
elseif open == true then
warn("SBD's opened, checking if in move!")
if db == false then
warn("SBD's not moving. Closing SBD's!")
db = true
local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,-math.rad(90),0)
for i = 0,1,.00001 do
local cfm = script.Parent.Parent.PrimaryPart.CFrame:Lerp(finish,i)
script.Parent.Parent:SetPrimaryPartCFrame(cfm)
wait()
end
open = false
warn("\nSBD's SUCCESSFULLY CLOSED!")
wait(1)
db = false
warn("\nPrepared to open!")
end
end
end)
(The doors itself are the ClickDetector, I made that just for testing.)

1 comment
Thank you so much, you helped me a lot!