Also, put the script that creates the Billboards inside the ServerScriptService.
This is the script that creates the Tag and adds it into the workspace.characters (folder of characters)
Show us the contents of the script, and donât put the playerâs characters inside a folder, and keep it inside the workspace!
I try the problem is that I have a lot of systems that works with this folder, only this one is causing me issues.
Hmm, can we see the entirety of the âOverHeadUIâ script?
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.
You are setting the parent of the character, which is the workspace. You should set the âcharâ instead, which is a model.
âCharactersâ is the folder name I told you, I have this overhead UI, and some others sytems working with the folder.
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â
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.
WAIT! You are cloning the HealthBarBackground (Frame), instead of the Tag (BillboardGui).
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.
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.
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.
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")