Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// You can tweak these setting below !
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(
- 10, -- Time to get to destination
- Enum.EasingStyle.Exponential, -- EasingStyle
- Enum.EasingDirection.InOut, -- EasingDirection
- 0, -- RepeatCount (when less than zero the tween will loop indefinitely)
- false, -- Reverses (tween will reverse once reaching it's goal)
- 0 -- DelayTime
- )
- --// ..But don't mess with anything below !
- local function tweenModel(model, CF)
- local CFrameValue = Instance.new("CFrameValue")
- CFrameValue.Value = model:GetPrimaryPartCFrame()
- CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
- model:SetPrimaryPartCFrame(CFrameValue.Value)
- end)
- local tween = tweenService:Create(CFrameValue, tweenInfo, {Value = CF})
- tween:Play()
- tween.Completed:connect(function()
- CFrameValue:Destroy()
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement