I am using a gui rescaler plugin that does work on everything, for some reason the size gets messed up anyways, and like i stated in the title it does work perfectly fine in the studio no matter how much i strech the screen it won't change.
Here's the script:
local frame = script.Parent
local background = frame:WaitForChild("HpBackground")
local hp = frame:WaitForChild("Hp")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character
local amount = frame:WaitForChild("Amountofhp")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
repeat wait() until character:FindFirstChild("Humanoid")
local humanoid = character:FindFirstChild("Humanoid")
humanoid.Changed:Connect(function(Property)
if Property == "Health" then
local health = humanoid.Health
local maxhealth = humanoid.MaxHealth
hp:TweenSize(UDim2.new( 0,health/maxhealth * 412,0,21),Enum.EasingDirection.Out,Enum.EasingStyle.Linear,.2)
amount.Text = math.floor(health+0.5) .. "/" .. math.floor(maxhealth+0.5)
end
end)

6 comments
the gui sizes?
0, 412 , 0 , 21
that's the size of the frame that tweens
It may be because you're tweening hp using the Offset values, instead of using Offset try using Scale instead UDim2.new(xScale, xOffset, yScale, yOffset)
then the question is how do i use those scale values when they are 0 and i am multiplying
nvm i figured out a way thanks