Help with my client tweens

So, this is the code i am using for doing tweens on the client side instead of the server side, and it’s asking me for a number argument, however the argument is given when the code for the tween runs, what happens is that the color tween works fine, but the model and part tweens ask me for the time argument, which is given on the code:

The code that i’m trying to run

local TweenModule = require(game.ServerScriptService.SharedModules.Tween)

TweenModule.TweenPart(Controls.Preparation.Main.MovePart,Controls.Preparation.Main.Middle.CFrame,true,0.25,Enum.EasingStyle.Sine)

The code that is required

local module = {}

module.TweenPart = function(Part, Cframe, WaitForComplete, TweenDuration, TweenInfoType)
	game.ReplicatedStorage.Events.TweenPart:FireAllClients(Part, Cframe, WaitForComplete, TweenInfoType)
end

module.TweenModel = function(Model, Cframe, WaitForComplete, TweenDuration, TweenInfoType)
	game.ReplicatedStorage.Events.TweenPart:FireAllClients(Model, Cframe, WaitForComplete, TweenInfoType)
end

module.TweenTransparency = function(Part, TransparencyToGo, WaitForComplete, TweenDuration)
	local Tween = game:GetService("TweenService")
	local ActualTween = Tween:Create(Part, TweenInfo.new(TweenDuration), {Transparency = TransparencyToGo})
	
	ActualTween:Play()
	if WaitForComplete == true then
		wait(TweenDuration)
	end
end

module.TweenColor = function(Part, WaitTime ,NewColor, WaitForComplete)
	game.ReplicatedStorage.Events.TweenColor:FireAllClients(Part, WaitTime ,NewColor, WaitForComplete)
end

module.TweenVolume = function(Sound, Time ,VolumeToGo, WaitForComplete)
	local TweenService = game:GetService("TweenService")
	local Tween = TweenService:Create(Sound, TweenInfo.new(time()), {Volume = VolumeToGo})

	Tween:Play()
	if WaitForComplete == true then
		wait(Time)
	end
end

module.TweenPlayback = function(Sound, Time ,ToGo, WaitForComplete)
	local TweenService = game:GetService("TweenService")
	local Tween = TweenService:Create(Sound, TweenInfo.new(time()), {PlaybackSpeed = ToGo})

	Tween:Play()
	if WaitForComplete == true then
		wait(Time)
	end
end

return module

The tween manager under ReplicatedFirst



game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TweenPart").OnClientEvent:Connect(function(Part, Cframe, WaitForComplete, TweenDuration, TweenInfoType)
	local Tween = game:GetService("TweenService")
	local Info = TweenInfo.new(TweenDuration,TweenInfoType,Enum.EasingDirection.InOut,0,false,0)
	local ActualTween = Tween:Create(Part,Info,{CFrame = Cframe})
	ActualTween:Play()
	if WaitForComplete == true then
		wait(TweenDuration)
	end
end)

game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TweenModel").OnClientEvent:Connect(function(Model, Cframe, WaitForComplete, TweenDuration, TweenInfoType)
	local Tween = game:GetService("TweenService")
	local Info = TweenInfo.new(TweenDuration,TweenInfoType,Enum.EasingDirection.InOut,0,false,0)
	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = Model:GetPrimaryPartCFrame()

	CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
		Model:SetPrimaryPartCFrame(CFrameValue.Value)
	end)

	Tween:Create(CFrameValue, Info, {Value = Cframe}):Play()

	if WaitForComplete == true then
		wait(TweenDuration)
	end
end)

game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TweenColor").OnClientEvent:Connect(function(Part, WaitTime ,NewColor, WaitForComplete)
	local TweenService = game:GetService("TweenService")
	local Tween = TweenService:Create(Part, TweenInfo.new(WaitTime), {Color = NewColor})
	Tween:Play()
	if WaitForComplete == true then
		wait(WaitTime)
	end
end)


If anyone can help me fix it, i would thank you so much.

I looked at your code, and from what I see you do pass in a time in the TweenPart function, but you never pass it when you call the TweenPart RemoteEvent

module.TweenPart = function(Part, Cframe, WaitForComplete, TweenDuration, TweenInfoType)
	game.ReplicatedStorage.Events.TweenPart:FireAllClients(Part, Cframe, WaitForComplete, TweenInfoType)
	-- TweenDuration isn't passed into the event, thus TweenInfoType is put as the duration, which errors
end

Apparently, the TweenModel module broke too, And it brings another error that says “No property named CFrame for X model”