Alright, so I made a health bar that appears over my head, however I don’t want to be able to see it.
I only want it to be visible to other players.
How do I make it happen?
Thanks!
Alright, so I made a health bar that appears over my head, however I don’t want to be able to see it.
I only want it to be visible to other players.
How do I make it happen?
Thanks!
just change the visibility on the client
that way the server can still see it but you can’t
you can disable it localy
so the player can’t see it but all else can
How do I do this? Also, I stumbled upon another issue while testing. The health bar only changes if I reset. It doesn’t change over the head of another player, or myself if I’m damaged.
just use a local script, and also I can’t help you with that, i’d need to see code
I’m not quite sure how to script that, I got this script from a video.
Where the script is:
This is how the code looks:
if player name = player you want then
disable billboardGui
Is the overhead GUI given once the character is added?
The script must be on ServerScriptService.
If so, Try doing this:
game:GetService("Players").PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local HealthBar = -- HealthBar path
HealthBar.PlayerToHideFrom = Player
end)
end)
The only issue for this is that I would want it to be disabled for the local player, not just one specific person
ik, when I said player you want, I meant the player that the gui is over, that should be easy to make a variable out of!
Ah sorry, I’m extremely new to scripting and it’s quite difficult to piece all of this together currently
that’s fine, just try to think outside of the box sometimes!
good day!
Wait a minute… is the script your showed us HealthGui
?
Why are you doing game.Players.LocalPlayer
in there? That can only be used in LocalScripts
I was messing around with various lines to attempt to get it to disable, forgot to take it out of the script before the screenshot
There’s a property called PlayertoHideFrom
on Billboards. Just set that property to the Player that has the healthbar and you’re pretty much set. No need to overcomplicate it.
Ah.
Inside the BillboardGui place a localscript.
In that script simply do something like
local me = game.Players.LocalPlayer
if script.Parent.Parent.Parent.Name == me.Name then
script.Parent.Enabled = false
end
Yes, I saw that. Except I only want local players to see it. I can’t set the property to a player with the health bar as everyone gets the health bar once spawned. It’s not linked to an actual part
You should set the property after it has been inserted, not during edit mode. Use the Players
service to get the player from the character and set the property to that player.
This worked perfectly! Just how I wanted. Now the only issue that I have is the health bar won’t be affected when I damage a player, it just stays still, doesn’t actual lower. When I would reset, it would originally change over my head, so I know it works
try a print in the function.
just simply do print(healthchange)