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

0

the gui sizes?

0

0, 412 , 0 , 21

0

that's the size of the frame that tweens

1

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)

0

then the question is how do i use those scale values when they are 0 and i am multiplying

0

nvm i figured out a way thanks