Health doesn't tween properly

So basically i was trying to make a boss fight, but when i tried to make a health tween, it just completely brokes and i dont know what to do. Before you ask, yes i did search the issue first but i couldn’t find a solution to it. There is no errors on the output either.

Script:

local sinisterM = game.ReplicatedStorage.HalloweenEnemies.SinisterM
local hum = sinisterM.Humanoid
local frame = script.Parent.HealthFrame
local service = game:GetService(‘TweenService’)
script.Parent.BossHealth.Text = hum.Health..‘/’..hum.MaxHealth
hum.Changed:Connect(function()
local scale = hum.Health / hum.MaxHealth
frame:TweenSize(UDim2.new(scale, 0.1), ‘InOut’, ‘Quint’, 0.3) --This thing doesn’t work properly
script.Parent.BossHealth.Text = hum.Health..‘/’..hum.MaxHealth
end)

Frame’s size i want to tween:
image

Video Issue:

this should func

local sinisterM = game.ReplicatedStorage.HalloweenEnemies.SinisterM
local hum = sinisterM:WaitForChild("Humanoid")
local frame = script.Parent.HealthFrame

script.Parent.BossHealth.Text = hum.Health…’/’…hum.MaxHealth
frame.Size = UDim2.new(scale,0, 0.1,0)
hum.Changed:Connect(function()
	local scale = hum.Health / hum.MaxHealth
	frame.Size = UDim2.new(scale,0, 0.1,0)
	script.Parent.BossHealth.Text = hum.Health…’/’…hum.MaxHealth
end)
1 Like

On First place, i think what the tweensize doesn’t func on Scripts, only in localscripts

And second this should func if the damage are not much the size “effect” should look good

1 Like

A little different but after i damage the humanoid frame doesn’t change anymore.


Btw tween service works on both server and local scripts, already tested it.

the scale should ve UDim2.new(Health/MaxHealth,0,YSize,0) and the bug should ve fixed

1 Like

yea but its highly prefered for the player’s client to handle tweens (unless really needed)

server doesn’t need to handle the computation plus its a gui it should already be being handled by local

1 Like

should it look like this?image

you need to replace ysize with the actual y size.

1 Like