I have a drawer open and close function the attribute “IsOpen” should be set to “not Isopen” which is basically the opisite of it’s current state however it stays as false and doesnt change.
script:
function furniture.OpenDrawer(drawer)
drawer:SetAttribute("Moving", true)
local isOpen = drawer:GetAttribute("Open")
local Direction = isOpen and 1 or -1
print(isOpen)
local cframe = drawer.CFrame * CFrame.new(0,0,1.5 * Direction)
local drawerTween = TweenService:Create(drawer, TweenInfo.new(0.5), {CFrame = cframe})
drawerTween:Play()
drawerTween.Completed:Wait()
drawerTween:SetAttribute("Moving", false)
drawerTween:SetAttribute("Open", not isOpen)
print(isOpen)
end