Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is this a proper way to wait a client tween?

I made a tween to animate a bomb expanding. After the tween(that lasts 1 second), the bomb explodes.

Part of the Server Script Code:

local player = game. players.SOMEPLAYER
local bomb = script.Parent
game.ReplicatedStorage.TweenBomb:FireAllClients(bomb)
wait(1)

Local Script Code(For a smoother animation):

local tweenservice = game:GetService("TweenService") 
function tweenBomb(bomb) 
local tweeninfo = TweenInfo.new(1,Enum.EasingType.Linear)
local goal = {} 
goal.Size = bomb.Size*2
local newTween = TweenService:Create(bomb,tweeninfo,goal) 
newTween:Play() 
end
game.ReplicatedStorage.TweenBomb.OnServerInvoke:Connect(tweenBomb) 

What I would like to know is if there is some problem that could happen with this method, like a notable lack of sincrony or the bomb taking longer to explode. If there is way that could fix such issue, I would like to know too.

1 answer

✓ Accepted answer

Because you made it on the client, it's good, but if it's on the client, there may be lag included in the tween because nobody has a perfect connection. And to be able to fix the lag, here is a link:

Improving game performance

This discussion is preserved as it was. New answers, comments, and votes are closed.