hello! im trying to make an openable drawer and i keep getting an error “Unable To Cast To Dictionary” And i dont know what to do. please help!
I will highlight where the error is
local TweenService = game:GetService(“TweenService”)
local Drawer = script.Parent.Parent.Parentlocal Opened = {}
Opened.Position = Drawer.TopDrawerOpenPos.Position
Opened.Orientation = Drawer.TopDrawerOpenPos.Orientationlocal Closed = {}
Closed.Position = Drawer.TopDrawerClosePos.Position
Closed.Orientation = Drawer.TopDrawerClosePos.Orientationlocal Opened = false
script.Parent.Triggered:Connect(function()
– local OpenTween = TweenService:Create(Drawer, TweenInfo.new(0.5), Opened)
– local CloseTween = TweenService:Create(Drawer, TweenInfo.new(0.5), Closed)
if Opened == false then
Opened = true
script.Parent.MaxActivationDistance = 0
workspace.Sfx.OpenDrawer:Play()
OpenTween:Play()
OpenTween.Completed:Wait()
script.Parent.MaxActivationDistance = 5
else
if Opened == true then
Opened = false
script.Parent.MaxActivationDistance = 0
workspace.Sfx.OpenDrawer:Play()
CloseTween:Play()
CloseTween.Completed:Wait()
script.Parent.MaxActivationDistance = 5
end
end
end)