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:
- this is a Local Script inside a model. The model's parent is Workspace
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.

4 comments
LocalScripts cannot run in the workspace. Consider putting it in a server script. http://wiki.roblox.com/index.php?title=API:Class/LocalScript
But the local script is in a model
It doesn't matter. They can only function in a Character Model, and services like Backpack, StarterGui, PlayerGui, PlayerScripts, and ReplicatedFirst.
k