Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with UDim!!!?

IS there a way to make a frame / image label scale using Udim by using scale and not offset? This is script I am using. It doesn't work unless scale for x and y is 0.

local PositionX = script.Parent.Position.X.Offset
local initX = script.Parent.Size.X.Offset
local p = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
while true do 
wait()
local PlayerHealth = p.Character.Humanoid.Health 
local PlayerMaxHealth = p.Character.Humanoid.MaxHealth
local Pie = (PlayerHealth / PlayerMaxHealth) --Missed Scale 
--script.Parent.Size = UDim2.new( 0, initX*Pie, 0, 20) 
script.Parent:TweenSize(UDim2.new(0, initX*Pie, 0, 20),"Out","Sine",0.25)
end 

3 comments

0

Please stop reposting the same question.

0

^

0

Its not the same question. And I wouldn't have to "repost" it if someone would answer it.

1 answer

✓ Accepted answer

All you have to do is use the tween like so:

script.Parent:TweenSize(UDim2.new(Pie, 0, 0, 20),"Out","Sine",0.25)

It works by using Pie as the percentage, Scale should be less then or equal to 1 and greater then 0

I hope this helped!

2 comments

0

Thank you so much this was what I was waiting for - DAYS

0

No Problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.