TweenService Support

Hey does anybody know how I can make the following TweenService script make the part run slower local TweenService = game:GetService(“TweenService”)
wait(.5)
local tweenstyle = TweenInfo.new(0.5,Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false ,0)
wait(.5)
local liftPositionUp = {CFrame = CFrame.new(1.83, 33.762, 32.561)}
wait(.5)
local LiftFloor = script.Parent
wait(.5)
local tweenfloorup = TweenService:Create(LiftFloor, tweenstyle, liftPositionUp)
wait(.5)
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild(“Humanoid”) then
tweenfloorup:Play()
end
end)
–Im trying to make an elavator

1 Like

You don’t have a debounce, and why are you putting wait(.5) after every line

1 Like
local ElevatorSpeed = 10

local TweenService = game:GetService(“TweenService”)
local tweenstyle = TweenInfo.new(ElevatorSpeed ,Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false ,0)
local liftPositionUp = {CFrame = CFrame.new(1.83, 33.762, 32.561)}
local LiftFloor = script.Parent
local tweenfloorup = TweenService:Create(LiftFloor, tweenstyle, liftPositionUp)
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild(“Humanoid”) then
tweenfloorup:Play()
end
end)

TweenInfo.new()'s first parameter is length of tween. so you can change them.
Anyways, I set ElevatorSpeed, so you can change them anytime you want.

Also, using TweenService as elevation might be not the best way.
Tweening from server will cause some lags, and I’m not sure if they’re gonna glitch or not, but I’m kinda curious.

Aaand, you don’t have to use wait(.5) every line, it will only takes 0.5 seconds for just setting variable.
They will operate completely, so you don’t have to care about.

Happy coding! :computer:

3 Likes

Tysm !! I really appreciate it this will also help me in the future

1 Like

didn’t help and also I was desperate lol

Gg thanks for the code hehe :slight_smile: :slight_smile: