local doorConfig = {}
function doorConfig.Animate(Part, Action)
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local OpenGoal = Part.CFrame * CFrame.Angles(0,math.rad(-110),0)
local CloseGoal = Part.CFrame * CFrame.Angles(0,0,0)
local OpenAnimation = TweenService:Create(Part, tweenInfo, OpenGoal)
local CloseAnimation = TweenService:Create(Part, tweenInfo, CloseGoal)
if Action == "Open" then
OpenAnimation:Play()
elseif Action == "Close" then
CloseAnimation:Play()
end
end
return doorConfig
Getting this error
17:26:18.479 Unable to cast to Dictionary - Server - DoorConfig:13
17:26:18.479 Stack Begin - Studio
17:26:18.479 Script 'ReplicatedStorage.Configs.DoorConfig', Line 13 - function Animate - Studio - DoorConfig:13
17:26:18.479 Script 'Workspace.Door_Model.Script', Line 10 - Studio - Script:10
17:26:18.479 Stack End - Studio
Server-Sided script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Door = script.Parent
local Hinge = Door.Hinge
local Configs = ReplicatedStorage:WaitForChild("Configs")
local DoorConfig = require(Configs.DoorConfig)
wait(2)
DoorConfig.Animate(Hinge, "Open")
wait(5)
DoorConfig.Animate(Hinge, "Close")
I need help fixing it please