### Query Documentation with GET Request Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/packets To get additional information not directly on the page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/packets.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/global-tweens To get more information not present on the page, make an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/global-tweens.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/introduction To get more information not explicitly on the page, make an HTTP GET request to the current URL with an 'ask' query parameter containing your question. ```http GET https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/introduction.md?ask= ``` -------------------------------- ### Start, Stop, and Resume Tween Playback Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Use Start() to begin or resume a tween. Use Stop() to pause playback, which can be resumed later with Start(). ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() -- Initial playback start. task.wait(1) tween:Stop() -- Stop after 1 second of playback. task.wait(1) tween:Start() -- Resume after a 1 second pause. ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/networking-library Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific, self-contained, and written in natural language. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ```http GET https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/networking-library.md?ask= ``` -------------------------------- ### Start Tween Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Starts or resumes playback of the tween. If the tween was stopped or reset, calling Start() will begin playback from the beginning or the last stopped position, respectively. ```APIDOC ## Start ### Description Starts or resumes playback of the tween. ### Method `Start()` ### Example Usage ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() -- Initial playback start. ``` ``` -------------------------------- ### Create and Start a Tween Source: https://alexxander.gitbook.io/tweenplus/tween-usage/states This script demonstrates how to create a tween with specific properties and start its execution. The created tween is also shared using a 'shared' table for potential access by other scripts. ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2, Repetitions = 5, Reverses = true}) shared.MyTween = tween -- Share the tween with other scripts. tween:Start() ``` -------------------------------- ### Querying Documentation Source: https://alexxander.gitbook.io/tweenplus/creation/options To get more information not present on the current page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://alexxander.gitbook.io/tweenplus/creation/options.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://alexxander.gitbook.io/tweenplus/creation/options/replicate To get more information not present on the current page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. This mechanism is useful for clarifications or retrieving related documentation. ```http GET https://alexxander.gitbook.io/tweenplus/creation/options/replicate.md?ask= ``` -------------------------------- ### Querying Documentation with 'ask' Parameter Source: https://alexxander.gitbook.io/tweenplus/creation/hidden-properties To get more information not present on the current page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://alexxander.gitbook.io/tweenplus/creation/hidden-properties.md?ask= ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking To get information not explicitly on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. Use this for clarifications or related documentation. ```http GET https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://alexxander.gitbook.io/tweenplus/creation/preallocations Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. Use this mechanism when the answer is not explicitly present or for clarification. ```http GET https://alexxander.gitbook.io/tweenplus/creation/preallocations.md?ask= ``` -------------------------------- ### Query Documentation with a Question Source: https://alexxander.gitbook.io/tweenplus/creation/introduction Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. ```http GET https://alexxander.gitbook.io/tweenplus/creation/introduction.md?ask= ``` -------------------------------- ### Querying Documentation with 'ask' Parameter Source: https://alexxander.gitbook.io/tweenplus/creation/options/custom-defaults To get additional information not directly present on the page, you can query the documentation dynamically. Perform an HTTP GET request with the 'ask' query parameter to receive a direct answer and relevant excerpts. ```http GET https://alexxander.gitbook.io/tweenplus/creation/options/custom-defaults.md?ask= ``` -------------------------------- ### Example of a single direction easing function Source: https://alexxander.gitbook.io/tweenplus/creation/custom-easing-functions This snippet shows how to define a single easing function, 'CoolEasing', which takes an alpha value and returns it. ```luau CoolEasing = function(alpha) return alpha end ``` -------------------------------- ### Example of an all directions easing function Source: https://alexxander.gitbook.io/tweenplus/creation/custom-easing-functions This snippet demonstrates defining an easing function, 'SuperCoolEasing', that includes implementations for 'In', 'Out', 'InOut', and 'OutIn' directions. ```luau SuperCoolEasing = { In = function(alpha) return alpha end, Out = function(alpha) return alpha end, InOut = function(alpha) return alpha end, OutIn = function(alpha) return alpha end } ``` -------------------------------- ### Stop Tween Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Stops playback of the tween. The tween can be resumed later by calling the Start() method. ```APIDOC ## Stop ### Description Stops playback of the tween. Can be resumed with `Start()`. ### Method `Stop()` ### Example Usage ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() task.wait(1) tween:Stop() -- Stop after 1 second of playback. ``` ``` -------------------------------- ### Reset and Destroy Tween Playback Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Use Reset() to stop a tween and return it to its starting values. Use Destroy() to permanently stop and invalidate the tween. ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() -- Initial playback start. task.wait(1) tween:Reset() -- Reset after 1 second of playback. tween:Start() -- Start playback from the beginning again. task.wait(1) tween:Destroy() -- Throw the tween in the trash! ``` -------------------------------- ### Tweening Attributes with Tween+ Source: https://alexxander.gitbook.io/tweenplus/creation/attributes Use attributes by prefixing their names with '@' in the tween properties table. This example shows how to tween a custom attribute named 'Coolness'. ```luau local tween = Tween( workspace.Part, { Position = Vector3.new(0, 10, 0), Color = Color3.fromRGB(255, 255, 0), ["@Coolness"] = 10 -- Attribute named 'Coolness'. } ) ``` -------------------------------- ### Reset Tween Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Stops playback of the tween and resets its state to the initial values. Playback can be restarted from the beginning using the Start() method. ```APIDOC ## Reset ### Description Stops playback of the tween, and resets to starting values. ### Method `Reset()` ### Example Usage ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() task.wait(1) tween:Reset() -- Reset after 1 second of playback. tween:Start() -- Start playback from the beginning again. ``` ``` -------------------------------- ### Creating a Tween with Options Source: https://alexxander.gitbook.io/tweenplus/creation/options Provide tween options like Time, EasingStyle, and EasingDirection when initializing a tween. Any options not specified will fall back to their default values. ```luau local tween = Tween( workspace.Part, { Position = Vector3.new(0, 10, 0), Color = Color3.fromRGB(255, 255, 0) }, { Time = 10, EasingStyle = "Sine", EasingDirection = "InOut" } ) ``` -------------------------------- ### Define Custom Easing Functions Source: https://alexxander.gitbook.io/tweenplus/creation/custom-easing-functions Create custom easing functions by returning a table of functions tagged as 'EasingFunctions'. You can define single-direction styles or all-direction styles. ```luau -- You can add any code here obviously :D return { -- You can either write a single direction style: CoolEasing = function(alpha) return alpha end, -- Or you can write an all directions style: SuperCoolEasing = { In = function(alpha) return alpha end, Out = function(alpha) return alpha end, InOut = function(alpha) return alpha end, OutIn = function(alpha) return alpha end } } ``` -------------------------------- ### Create a Tween with Multiple Properties Source: https://alexxander.gitbook.io/tweenplus/creation/introduction Input all the values you would like to tween into the second argument of the Tween function. You can tween properties like Position and Color. ```luau local tween = Tween( workspace.Part, { Position = Vector3.new(0, 10, 0), Color = Color3.fromRGB(255, 255, 0) -- And as many more as you’d like. } ) ``` -------------------------------- ### Require TweenPlus Module Source: https://alexxander.gitbook.io/tweenplus/creation/introduction This snippet shows how to require the TweenPlus module. The module returns a function that is used to create tweens. ```luau local Tween = require(script.TweenPlus) local tween = Tween( workspace.Part, -- Instance to tween. {} -- Values to tween. ) ``` -------------------------------- ### Connect to Tween Updated Signal Source: https://alexxander.gitbook.io/tweenplus/tween-usage/signals Connect to the Updated signal to receive callbacks every time the tween's values are updated. This is useful for tracking progress in real-time. Ensure the module is tagged 'Signal'. ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween.Updated:Connect(function() -- Alpha is in the range 0-1, so we multiply by 100 to get the percentage. print("Progress: "..tween.Alpha*100.."%") -- For example "Progress: 50%". end) tween:Start() ``` -------------------------------- ### Define Tween+ Packets Source: https://alexxander.gitbook.io/tweenplus/global-tweens-and-networking/packets This code defines the essential packets required for Tween+ networking. Ensure these exact definitions are included in your `Packets` ModuleScript for the library to function correctly. You can add custom packets after these definitions. ```luau local Packet = require(script.Packet) return { CreateTween = Packet(Packet.NumberU8, Packet.Instance, Packet.Any, Packet.Any), StartTween = Packet(Packet.NumberU8, Packet.Any, Packet.Any), StopTween = Packet(Packet.NumberU8), ResetTween = Packet(Packet.NumberU8), DestroyTween = Packet(Packet.NumberU8) } ``` -------------------------------- ### Default TweenPlus Defaults Source: https://alexxander.gitbook.io/tweenplus/creation/options/custom-defaults This is the default configuration for TweenPlus. You can override any of these properties by creating a module tagged 'TweenDefaults'. ```lua return { Time = 1, EasingStyle = "Linear", EasingDirection = "In", DelayTime = 0, Reverses = false, RepeatCount = 0, FPS = nil, Replicate = false } ``` -------------------------------- ### Query Tween State Source: https://alexxander.gitbook.io/tweenplus/tween-usage/states This script waits for a duration and then checks the state of a previously shared tween. It prints messages indicating whether the tween is still playing and provides details about its current progress, repetitions, and direction. ```luau task.wait(5) if shared.MyTween.Playing then print("Tween is still playing, wow!") -- Let’s print some information about the progress! print("Tween is going "..(if shared.MyTween.Reverses then " in reverse" else "forward").."!") print("Tween has done "..shared.MyTween.Repetitions.." repetitions!") print("Tween is exactly "..shared.MyTween.Alpha*100.."% done with the current repetition.") -- Alpha is in the range 0-1, so we multiply by 100 to get the percentage. else print("Tween is not playing anymore :(") end ``` -------------------------------- ### Tweening the Pivot Property Source: https://alexxander.gitbook.io/tweenplus/creation/hidden-properties Use this snippet to tween the 'Pivot' property of an object. Access and modify the pivot using :GetPivot() and :PivotTo(). ```luau local tween = Tween( workspace.Model, { Pivot = workspace.Model:GetPivot().CFrame -- The hidden 'Pivot' property. Read/write with :GetPivot() and :PivotTo() } ) ``` -------------------------------- ### Destroy Tween Source: https://alexxander.gitbook.io/tweenplus/tween-usage/playback-and-control Makes the tween unusable and ensures it is stopped. This is typically used to clean up resources when a tween is no longer needed. ```APIDOC ## Destroy ### Description Makes the tween unusable, and ensures it’s stopped. ### Method `Destroy()` ### Example Usage ```luau local tween = Tween(workspace.Part, {Transparency = 1}, {Time = 2}) tween:Start() task.wait(1) tween:Destroy() -- Throw the tween in the trash! ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.