So, I basically looked up on YT multiple tutorials to see my error but I can’t seem to find it.
For some information please message it down below. Also, the lighter part’s of the door is a mesh, do I need to change it too?
I cannot help you unless I know what the door is meant to do, how it is supposed to work and what the error / problem is. Can you also paste your current script in here?
"local Hinge = script.Parent.PrimaryPart
local opened = false
function OpenDoor()
if opened == false then
opened = true
for i = 1, 21 do
script.Parent:SetPrimaryPartCFrame(Hinge.CFrameCFrame.Angles(0, math.rad(5), 0))
wait()
end
else
opened = false
for i = 1, 21 do
script.Parent:SetPrimaryPartCFrame(Hinge.CFrameCFrame.Angles(0, math.rad(-5), 0))
wait()
end
end
end
Alright!
Where should I put the script?
I made a model with the door parts and another with the frame. Do I put it in the Door Model or in the main part of it?
Hey man, I highly suggest using TweenService, CFraming doors like these with this method can cause a LOT of lag on the serverside if you end up having a lot, it causes issues with performance.
I highly suggest considering this alternative as it is more performance-friendly and way smooth