I have health gui for a boss in my game. It goes up and down depending on the health. When I had a friend play the game with me, we found out that the boss's health would only change the gui if you were the one who shot it. If someone else shot it, it wouldn't change at all.
It is a local script, and I don't know how to change it into a script.
Here is my script:
wait (.1) local visible = script.Parent.Parent.Parent.Visible local bframe = script.Parent.Parent.Parent.Parent while true do local hp = game.Workspace.Dummy.Humanoid.Health/500 script.Parent:TweenSize(UDim2.new(hp,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.15) wait (0.1) if hp < 0.01 or hp == 0 then bframe.BaseFrame.Visible = false wait (7) bframe.BaseFrame.Visible = true script.Parent:TweenSize(UDim2.new(0,647,0,70)) script.Parent:TweenSize(UDim2.new(hp,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.15) local d = game.Workspace:WaitForChild("Dummy") local hp = d.Humanoid.Health/300 script.Parent:TweenSize(UDim2.new(hp,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.15) end wait (.2) end
Whenever you change the health, instead of putting that line use a remote event and use the FireServer() function and put in the the health you want to change it to.
Then, when it goes to the server, use the :FireAllClients() function to make it change for everyone's gui.
Read about remote events and FireServer and FireAllClients on Roblox Developer Hub.