Making a draining Frame bar

So, im trying to make a bar that drains after a bit of time and it is getting smaller instead of draining from the right to the left and im having trouble fixing it so here are the scripts and a representation to help


Screenshot 2024-08-20 182631 assistant didnt help either​:sob::sob::sob:

2 Likes

Is the variable frame pointing towards the green bar or the dark one ?

Idk what you mean by “draining”, doesn’t it basically mean to shrink the frame? I’d rather use this script

local percentage = 100
local TI = TweenInfo.new(.1,Enum.EasingStyle.Linear, Enum.EasingDirection.In)
repeat
   percentage -= sinkrate 
   TS:Create(frame, ti, {Size = Udim2.fromScale(percentage /100,1):Play()
    task.wait()
until
   frame.Size.X.Scale < sinkrate

might want to check the ui anchor point, that could also be the problem, either set it to 0 or 0.5 on the x and y scale.

I don’t think there’s anything wrong with the anchor point since it’s draining from right to left like he wants

The problem might come from the third parameter in UDim2.new() : try replacing frame.Size.Y.Scale by a fixed value like 1, or .8

It is pointing towards the green bar

it looks like you have a ui aspect ratio inside the frame instance, delete it and it will be fixed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.