[SOLVED] Overhead bar Ui not showing correctly for all players, only local

Also, put the script that creates the Billboards inside the ServerScriptService.

1 Like

This is the script that creates the Tag and adds it into the workspace.characters (folder of characters)

12

1 Like

Show us the contents of the script, and don’t put the player’s characters inside a folder, and keep it inside the workspace!

1 Like

I try the problem is that I have a lot of systems that works with this folder, only this one is causing me issues.

1 Like

Hmm, can we see the entirety of the ‘OverHeadUI’ script?

1 Like

Sure I show you a part of it.

The healthbar is not here I tried adding it but doesn’t work.

local ServerStorage = game:GetService("ServerStorage")
local Tag = ServerStorage.Tag

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		repeat wait()  char.Parent = workspace.Characters until char.Parent == workspace.Characters
		
		local CloneTag = Tag:Clone()
		local NameTag = CloneTag.NameTag
		local RankTag = CloneTag.RankTag
		local ClanValue = char:WaitForChild("PlayerStats").Clan
		local RaceValue = char:WaitForChild("PlayerStats").Race

		CloneTag.Parent = char.Head
		
		NameTag.Text = player.DisplayName
		RankTag.Text = char.PlayerStats.Race.Value

Below this is where I add the values, that doesn’t cause any issues with the healthbar.

1 Like

You are setting the parent of the character, which is the workspace. You should set the ‘char’ instead, which is a model.

1 Like

“Characters” is the folder name I told you, I have this overhead UI, and some others sytems working with the folder.

1 Like

No! I mean like,

You are setting the character’s parent, once the character is loaded in, the parent is the workspace.

Then, you are checking if the character’s parent, which is the workspace, is the folder, ‘Characters’

1 Like

Should I remove the second part?

Also I tried this code in a server side script in “ServerScriptService”

local ServerStorage = game:GetService("ServerStorage")
local Tag = ServerStorage.Tag

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		repeat wait()  char.Parent = workspace.Characters until char.Parent == workspace.Characters
		
		local CloneTag = Tag.HealthBarBackground:Clone()
		local HealthBar = CloneTag.HealthBar
		
		CloneTag.Parent = char.Head
		
		wait(1)
		while wait() do
			HealthBar = UDim2.new(char.Humanoid.Health / char.Humanoid.MaxHealth, 0, 1, 0)
		end		
		
		
		
end)
end)

But this happens, now everyone sees this.

1

1 Like

WAIT! You are cloning the HealthBarBackground (Frame), instead of the Tag (BillboardGui).

1 Like

Yeah I know I tried this now, because if I just add the “Tag” it clones two times the Tag, while doing this is only clones it 1 time.

I deleted the script but how could I add it inside the OverheadUI? I mean just adding the health code.

1 Like

Try this as the code,

local TagBillboard = game:GetService("ServerStorage"):WaitForChild("Tag")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local tagClone = TagBillboard:Clone()
        tagClone.Parent = char.Head
        
        -- Property Stuff Here
        char.Humanoid.HealthChanged:Connect(function()
               -- Scaling Stuff Here
        end)
    end)
end)

YOU AREN’T SETTING THE SIZE FOR THE HEALTH BAR!!!

I tried and still doesn’t work, I’m not an scripter lol, I’ve made and fixed difficults scripts but I can’t fix this one. :sweat_smile:

Replace it with this:

while wait() do
	HealthBar.Size = UDim2.new(char.Humanoid.Health / char.Humanoid.MaxHealth, 0, 1, 0)
end

Nope still the same, I don’t know what is wrong also I’m not getting any error in the console.

Can I see your updated script? And the link to the game?

I give you a link soon if I can’t fix this for now.

Here is where the script is located.

12

The code

local ServerStorage = game:GetService("ServerStorage")
local Tag = ServerStorage.Tag

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		repeat wait()  char.Parent = workspace.Characters until char.Parent == workspace.Characters

		local CloneTag = Tag.HealthBarBackground:Clone()
		local HealthBar = CloneTag.HealthBar

		CloneTag.Parent = char.Head

		wait(1)
		while wait() do
			HealthBar.Size = UDim2.new(char.Humanoid.Health / char.Humanoid.MaxHealth, 0, 1, 0)
		end	
	end)
end)

[quote=“C1P, post:39, topic:3001143, username:C1_PH3R”]

		local CloneTag = Tag.HealthBarBackground:Clone()
		local HealthBar = CloneTag.HealthBar

[/quote]Update this to:

local CloneTag = Tag:Clone()
local HealthBarBackground = CloneTag:WaitForChild("HealthBarBackground")
local HealthBar = HealthBarBackground:WaitForChild("HealthBar")