Hey there, quick question!
Im goofing arround with tweenings and i decided to try out this plugin (wich makes easy and simple tweenings)
The plugin created the tweening scripts and i tried to loop both tweens (because the plugin can’t do it)
So, i just mixed both scripts and added a Return at the end:
local tweenservice = game:GetService("TweenService")
local target = game:GetService("Workspace"):FindFirstChild(script.Target.Value)
local info = TweenInfo.new(
script.Duration.Value,
Enum.EasingStyle.Cubic,
Enum.EasingDirection.InOut,
0,
false,
0
)
local goal = {}
goal.CFrame = target.CFrame
local tween = tweenservice:Create(script.Parent, info, goal)
tween:Play()
--------------------------------
wait(25)
--------------------------------
local tweenservice = game:GetService("TweenService")
local target = game:GetService("Workspace"):FindFirstChild(script.Target2.Value)
local info = TweenInfo.new(
script.Duration2.Value,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local goal = {}
goal.CFrame = target.CFrame
local tween = tweenservice:Create(script.Parent, info, goal)
tween:Play()
---------------------------------------------------
wait(25)
-----------------------------------------------------
return
This code is not looping the tween, it only works one time!
EDIT: This script has some values parented to it (if you haven’t noticed) This parents are:
- Duration
- Duration2
- Target
- Target2
Thank you!