So I'm trying to make a health bar for a custom Part. But it isn't working and there are no errors.
Here are notes:
Here is my script;
local HealthBar = script.Parent:WaitForChild('BlueSpawn').BillboardGui.HealthFrame.HealthBar local HealthText = HealthBar.HealthText local HP = script.Parent:WaitForChild('Stats').HP local MaxHP = script.Parent:WaitForChild('Stats').MaxHP wait() local HealthPercentage = HP / MaxHP HealthText.Text = HP.Value..' / '..MaxHP.Value HealthBar.Size = UDim2.new(HealthPercentage, 0, 1, 0)
The thing is I set the HP to 100 and Max Hp to 300 but it doesn't show 100 / 300.
Perhaps I should change to server script? Please help. I'm going to add a .Changed function later so that if damaged it will be effected.