Advertisement
HowToRoblox

CircleHandler

Jul 2nd, 2021
3,541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local leftFrame = script.Parent:WaitForChild("LeftBG"):WaitForChild("LeftFrame")
  2. local rightFrame = script.Parent:WaitForChild("RightBG"):WaitForChild("RightFrame")
  3.  
  4.  
  5. local ts = game:GetService("TweenService")
  6. local ti = TweenInfo.new(5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
  7.  
  8.  
  9. local numValue = Instance.new("NumberValue")
  10.  
  11.  
  12. numValue.Changed:Connect(function()
  13.    
  14.    
  15.     local rightRot = math.clamp(numValue.Value - 180, -180, 0)
  16.    
  17.     rightFrame.Rotation = rightRot
  18.    
  19.    
  20.     if numValue.Value <= 180 then
  21.        
  22.         leftFrame.Visible = false
  23.        
  24.        
  25.     else
  26.        
  27.         local leftRot = math.clamp(numValue.Value - 360, -180, 0)
  28.        
  29.         leftFrame.Rotation = leftRot
  30.        
  31.         leftFrame.Visible = true
  32.     end
  33. end)
  34.  
  35.  
  36. function progressBar()
  37.    
  38.     numValue.Value = 0
  39.  
  40.     local progressTween = ts:Create(numValue, ti, {Value = 360})
  41.     progressTween:Play()
  42. end
  43.  
  44.  
  45. progressBar()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement