Tween not playing

I was making a script for my elevator and I went into a problem. When I play the game, the elevator doesn’t go down. Here is the script.

local model = script.Parent
local primary = model.PrimaryPart
local tweenservice = game:GetService("TweenService")
local debounce = false

function ending()
	workspace["PM (PlaceholderMusic)"]["Elevator Jammed"]:Play() --i have too much placeholder songs and too much placeholder animations sry
	task.wait(1)
	local tween = tweenservice:Create(primary,TweenInfo.new(25.3, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {Position = Vector3.new(primary.Position.X,primary.Position.Y - 175,primary.Position.Z)})
	tween:Play()
	tween.Completed:Wait()
	local ahhhhtween = tweenservice:Create(primary,TweenInfo.new(15, Enum.EasingStyle.Circular, Enum.EasingDirection.In), {Position = Vector3.new(primary.CFrame.X,primary.CFrame.Y - 3000,primary.CFrame.Z)})
	ahhhhtween:Play()
end

primary.Touched:Connect(function(hit)
	print(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if debounce == false then
			debounce = true
			local weld = Instance.new("WeldConstraint")
			local anim = Instance.new("Animation")
			anim.AnimationId = "rbxassetid://103845461454072"
			local rahhhh = hit.Parent.Humanoid:LoadAnimation(anim)
			rahhhh:Play()
			hit.Parent.HumanoidRootPart.CFrame = model.tppart.CFrame
			weld.Parent = model
			weld.Part0 = hit.Parent.HumanoidRootPart
			weld.Part1 = primary
			task.wait(0.3)
			ending()
		end
	end
end)

And here is the video


I used noclip to show that it doesn’t move

I don’t see why this script wouldn’t work other than that you might need to use CFrame instead of Position, Does the console show any errors?

1 Like

I originally used CFrame but it rotates to the original orientation if rotated.

Instead of redefining CFrame you should use an offset. Example: CFrame = primary.CFrame + Vector3.new(0,0,0)

1 Like

Oh right. Maybe I should have primary.CFrame instead of primary.Position. Thanks for the tip!