hello there, I ask for help again on scripting support channel for find someone who could help me with Boss Health Bar GUI, I have attempted to create an boss Health GUI based off from this another forum topic post, here is the hyperlink of that topic post: To the sorbiouse’s forum topic about boss health bar GUI
-
What I want to achieve: I want to make the contents inside the BillBoardGui inside the humanoid named “Enemy” thatt is inside Boss character’s model gets copied inside PlayerGui.BossHealthBarCopyGui.BossHealthBarFrame
and I also want when the boss mob of that boss health bar does dies, I want the remaining contents that has been copied from the billboardGui to Destroy() itself… -
*but the issue is that the script I will show you below would not work in that order… I have no idea why that codes wouldn’t work as intended…
*
-
**I have tried to run the game multiple times and pasted the contents on the billboardgui inside the humanoid of that enemy boss mob to see if it works, but it did not worked well again…
now I will show you these script codes below, I will be waiting to find some peoples to help me with it
-- this script is located in Workspace.Mobs.GigantiumGoblin.Enemy.Script
local Mob = script.Parent
local Enemy = Mob.Enemy
local player = game.Players.LocalPlayer
local playerBossHealthBarGUI = player.PlayerGui:WaitForChild("BossHealthBarCopyGui").BossHealthBarFrame
local signal = Enemy:GetPropertyChangedSignal("Health"):Connect(function()
end)
local deathsig = boss.Humanoid.Died:Connect(function()
signal:Disconnect()
end)
deathsig:Disconnect()
boss = nil
Enemy.HealthChanged:Connect(function()
local BossHealthBarCopy = script.Parent.BillboardGui:GetChildren()
for i,v in pairs(BossHealthBarCopy:GetChildren()) do
v:Clone()
v.Parent = playerBossHealthBarGUI
if signal:Disconnect() then
for i,v in pairs(playerBossHealthBarGUI:GetChildren()) do
v:Destroy()
end
end
end
end)
thanks for reading all of this topic posts, it helps me a lot ;> - mari