Hello,
So I need some help here. How would I go about making it so that this script moves an entire model? Right now, it moves just a brick called 'Curtain'. If someone could please help that would be much appreciated.
Thanks, Anthony
local detector = game.Workspace.Part.ClickDetector;
local tween_service = game:GetService("TweenService")
local curtain = workspace:WaitForChild("Curtain");
local old_pos = curtain.CFrame;
local first = false;
local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut);
local y = 50;
local cframe;
local PartB = part --Identify the part you want the curtain to move to.
function move_part()
if first == false then
first = true;
cframe = PartB.CFrame --The cframe goal for the curtain.
else
first = false;
cframe = old_pos;
end
local goal = {CFrame = cframe};
local tween = tween_service:Create(curtain, info, goal);
tween:Play();
end
detector.MouseClick:Connect(move_part);

1 comment
I'm not sure if the tween service will work with full models. I'd probably just use PrimaryPartCFrame and do the tweening myself