So I have this GUI here and you can see that the red, green, and yellow frames are “zones” and the white GUI is a bar. The bar will move around and the player has to press E to time it right to be on the green zone. However, I am very confused on how TweenService works with GUIs. The bar’s kind of related to Robeats in a way since you have to time it right to hit it in the defined zone.
Here’s the picture: https://gyazo.com/aa7e398348b76a9ee0826cfbab2f5c5d
Here’s my script:
local TweenService = game:GetService("TweenService")
---------------------------------------------------------------
local Bar = script.Parent
local goal1 = {}
goal1.Position = UDim2.new(0.825,0,0.743,0)
local tweenInfo1 = TweenInfo.new(1.5)
local tween1 = TweenService:Create(Bar, tweenInfo1, goal1)
---------------------------------------------------------------
local goal2 = {}
goal2.Position = UDim2.new(0.163,0,0.743,0)
local tweenInfo2 = TweenInfo.new(1.5)
local tween2 = TweenService:Create(Bar, tweenInfo2, goal2)
---------------------------------------------------------------
if Bar.Position == UDim2.new(0.163,0,0.743,0) then
tween1:Play()
end
if Bar.Position == UDim2.new(0.825,0,0.743,0) then
tween2:Play()
end