Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with UDim!!!?

Asked by 9 years ago

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 

0
Please stop reposting the same question. woodengop 1134 — 9y
0
^ unmiss 337 — 9y
0
Its not the same question. And I wouldn't have to "repost" it if someone would answer it. attackonkyojin 135 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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!

0
Thank you so much this was what I was waiting for - DAYS attackonkyojin 135 — 9y
0
No Problem! TheDarkOrganism 173 — 9y
Ad

Answer this question