Tween not working in module script

I’m trying to make a tween function in my module script. But I keep getting the error “Unable to cast to dictionary”. Both scripts are below. All help appreciated!

Module Script:

module.tween = function(part, goal, duration, easingDirection, easingStyle)
	local TweenService = game:GetService("TweenService")
	local tweenInfo =, easingStyle, easingDirection, 0, false, 0)

	local tween = TweenService:Create(part, tweenInfo, goal)


Server Script:

moduleScript.tween(game.Workspace.Part,, 4.25, -6.63), 1, Enum.EasingDirection.In, Enum.EasingStyle.Linear)

Your issue is that you’re passing in a Vector3 when the goal expects a dictionary, try this?

modubeScript.tween(game.Workspace.Part, {Position =, 4.25, -6.63)}, 1, Enum.EasingDirection.In, Enum.EasingStyle.Linear)

So it tweens the position

1 Like