- **What do you want to achieve?
Fix the issue so that I can return the Tween, for the purpose of running code when the tween is completed on the server.
- **What is the issue?
The client code does not return the “Tween” variable when be invoked.
- **What solutions have you tried so far?
I checked out the related documentation to no result.
-- Server:
local Tween = RenderEvent:InvokeClient(Player, {
"Tween",
AttachmentTwo,
{
.5,
Enum.EasingStyle.Quart,
Enum.EasingDirection.Out,
0,
false
},
{
CFrame = AttachmentOne.CFrame * CFrame.new(5,0,0)
}
})
--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