Here is some example code that you should be able to use to replace your for loops:
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
2, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
Part = buttonstand
local tween1 = TweenService:Create(Part, tweenInfo, {Position = Vector3.new(0, 10, 20)})
tween1:Play()
This tweens “Part”, to the Vector3 position inside the TweenService:Create()
Resources:
Also, for future reference, it’s really appreciated if you wrap your code with ```, so that is is more readable.