--Client
RenderEvent.OnClientInvoke = (function(Data)
local Type = Data[1]
if Type == "Tween" then
local Tween = TweenModule.TweenItems(Data)
print(Tween)
return Tween
end
end)
--Module
local Tween = {}
local TweenService = game:GetService("TweenService")
Tween.TweenItems = function(Data)
local Item = Data[2]
local Tweeninfo = Data[3]
local TweenGoal = Data[4]
local Tweeninfo = TweenInfo.new(Tweeninfo[1], Tweeninfo[2], Tweeninfo[3], Tweeninfo[4])
local Tween = TweenService:Create(Item, Tweeninfo, TweenGoal)
Tween:Play()
return Tween
end
return Tween
Using InvokeClient is a bad idea: If the player leaves before they send a response, the server will be left waiting indefinitely. It’s recommeded to use RemoteEvents to send data from the client to the server, to prevent this kind of issue from occurring
Is there a particular reason as to why you’re creating the TweenInfo on the server, sending it to the client, creating the Tween on the client, then sending it back to the server?