Is there any messages in output?
:
Oh its same thing where did you put other server script
you can change the world stud offset to a vector like Vector3.new(0,2,0)
to move it
1 Like
i expected this to be a small and quick post but it’s obviously not
nothing here even works
1 Like
you haven’t added in Gui:Clone().Parent = char.Head
in you first script and also i think serverstorage is better place for billboard gui
Sorry i made mistakes,It’s nighttime at my place now.
Where do I put the code line? (moved the gui to server storage)
Wait a sec i gonna give you full scripts that is way better
First:
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local Gui = ServerStorage.HealthBar
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
Gui:Clone().Parent = char.Head
end)
end)
Second
-- GUI script
local frame = script.Parent
local meter = frame.Meter
local label = frame.Label
local character = frame.Parent.Parent.Parent
local humanoid = character:WaitForChild("Humanoid")
label.Text = humanoid.Health .. "/" .. humanoid.MaxHealth
meter.Size = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
local Health = math.floor(humanoid.Health)
label.Text = Health.. "/" .. humanoid.MaxHealth
meter.Size = UDim2.new(humanoid.Health / humanoid.MaxHealth, 0, 1, 0)
if humanoid.Health == humanoid.MaxHealth then
frame.Visible = false
else
frame.Visible = true
end
end)
1 Like
Finally worked, thank you so much.
1 Like