ClientTween | Create Client-Sided Tweens from the Server

Getting Started:

  1. Download the resource here.
  2. Place ClientTween module under ReplicatedStorage.
  3. Place CT_Initialize local script under StarterPlayer > StarterPlayerScripts.

Require the module:

local tweenClient = require(game:GetService(“ReplicatedStorage”):WaitForChild(“ClientTween”))

Create a tween:

local tween = tweenClient.Create()

Play / Pause / Cancel / Reset a tween:

tween:Play()
tween:Pause()
tween:Cancel()
tween:Reset() – Not a ROBLOX original method

Methods of a tween are the same as ROBLOX’s tween methods, except for the :Reset() method.
:Reset() works like :Cancel() except it will revert the instance’s properties to how they were before tweening.

Pass a player or table of players to any method of a tween to specify clients, passing nil works on all clients:

tween:Play(game.Players.Player1) -- Single player
tween:Cancel({game.Players.Player1, game.Players.Player2}) -- Table of players
tween:Pause() -- Works on all clients

Use the .Completed() method which fires when a tween finished successfully or is paused with :Pause().

tween.Completed:Wait()  -- Want to wait until a tween completes?
tween.Completed:Connect(function()
    -- Want to run some code when a tween completes?
end)

It is as simple as that, hope you find this useful!

No license attributed, free to use however you want!

6 Likes

Does this have a license? If not, could you attach one or state it in the post?

No license, none of my resources have a license

Noticed an issue with your lerp function. This will only work with values that have the Lerp method.

Here’s an example of tweening the Brightness of a SpotLight:


{929E61B9-EB3D-4547-9C10-70542F4D6834}

There are plenty of properties that use numbers and other values this wouldn’t work with. You should add a lerp function for each tweenable datatype: