I’m making a game where enemies spawned have visible healthbars. For some reason, these healthbars stopped showing up on the client but switching to the server shows them working completely fine. I have the adornee set and all and it was working earlier. I added some new UI to the game but I’m not sure why that would change anything.
Show me the propertys of the gui and the the script that make the gui
There is no script that creates the UI. The code in the billboard only changes size/color (which appears on server)
The code that spawns the enemy:
EnemyFolder is a folder in workspace (this is a server script)
Change it a lil bit make the gui like in the replicated storage and then when the npc is created copy the gui and parent it to the npc if u asking about the scripts try to:
Put the gui in the replicated storage turn off the scripts
2.when the npc is spawned add the gui and turn the script after adding it
If u want to show code again add this
(```lua)
Then end it down with ```
Still doesn’t work but some reason resetting character fixes it whether ResetOnSpawn is true or not
Oh wait! Add adorne to the gui when adding the character like
Gui.Adornee = path to the head of the copied npc
i did that lol, i think its just some roblox issue i’ll find another way to fix it
Well it’s weird or wait for someone knows about guis more and scripting
You might consider parenting the BillboardGui
in the Clients PlayerGui
and setting the adornee from there.
There’s some talk about it here: In-Experience UI
Fire a RemoteEvent to each client and have them create the GUI locally in a LocalScript this i am pretty sure will work the script of the gui add it to the clien side like
local gui = — path to the gui in replicated storage
local reEvent = — path remote event that inside the replicated storage
reEvent.OnClientEvent:Connect(function(NpcModel)
local newGui = gui:Clone()
newGui.Parent = theNpcHead or u can adrone
local npcHumanoid = NpcModel.Humanoid
— add the gui functionality here like the code that u sent for the gui
end)
And in the server side fire the remote ecent to all clients and put the Npc as first parameter
This is a local script put it inside the StarterPlayer
Woops, guess it had to do with setting the camera mode to Fixed. When I changed it to something else like Scriptable, the health bars showed up again. Really weird too because when I cloned NEW noobs on the client THEY had visible health bars for some reason.
Ohh so if it’s scriptable the player can’t see the gui this is weird ngl will new information!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.