I’ve tried replicating this with a pivot part, but when welding the pan to the pivot part, it doesn’t seem to move the pan with the part. The weld stays put, yet just fails to to its job. Might be with not being able to tween welded objects, but who knows.
You just have to put your Part and Pan into a model, then weld the Pan to the part.
Once it is done, you have to use the Part “CFrame” to tween his position or rotation, tweening it using part.position or part.rotation is automaticaly destroying the weld…
local TweenService = game:GetService("TweenService")
local TweenInfos = TweenInfo.new(0.5)
local Part = script.Parent.Part
local Bool = true
local Goal = {}
while wait(1)do
if Bool == true then
Bool = false
Goal.CFrame = Part.CFrame * CFrame.Angles(math.rad(45), 0, 0)
local Tween = TweenService:Create(Part, TweenInfos, Goal)
Tween:Play()
elseif Bool == false then
Bool = true
Goal.CFrame = Part.CFrame * CFrame.Angles(math.rad(-45), 0, 0)
local Tween = TweenService:Create(Part, TweenInfos, Goal)
Tween:Play()
end
end