Problem:
So I’ve been making a module to help me with tweening, the goal of the module is to
sync tweens across clients.
The following code works on fresh new baseplates but when integrated within my own personal project it doesn’t even tween the player.
Code:
TweenSyncEvent.OnClientEvent:Connect(function(tweenDataObject: StringValue, Data: string)
local function DataParser(Data: {})
local code = "return " .. Data
return Loadstring(code)()
end
local success, decodedTweenData: { Part: string, Info: TweenInfo, Goal: {Properties: string, Value: any} } = pcall(function()
return HttpService:JSONDecode(Data)
end)
if success and decodedTweenData then
local Part = DataParser(decodedTweenData.Part)
local Info = TweenInfo.new(unpack(decodedTweenData.Info))
local Property = decodedTweenData.Goal.Property
local Value = DataParser(decodedTweenData.Goal.Value)
local Goal = {[Property] = Value}
local Tween = TweenService:Create(Part, Info, Goal)
Tween:Play()
end
TweenSyncEvent:FireServer(tweenDataObject, "")
end)
Help:
I’ve done debugging with print statements, and it still doesn’t tween.
Any help is appreciated, please and thank you!
Edit
I forgot to mention that all values are present and valid for the TweenService:Create() function.
As shown here:
And I’m using the vLua module for the “Loadstring()” function.