Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Name-tag only visible to team members?

Asked by 9 years ago

Would this take a Script or a LocalScript? I'm not request A whole Script.

2 answers

Log in to vote
1
Answered by 9 years ago

This Forum Should Be Able To Help With Your Name Tags: http://www.roblox.com/Forum/ShowPost.aspx?PostID=62985433

Ad
Log in to vote
-1
Answered by
IXLKIDDO 110
9 years ago

So, if anyone believes this is wrong feel free to correct me, but you might be able to do this in a localscript. I won't tell you the exact code, but some that may be able to help you.

First, you could make it so that it does a loop so that it also takes place whenever someone changes teams. For this I would use the following code:

while wait() do
    --Input code here
end

This part of repeats forever and will make whatever is inside of it repeat as well.

Since it is a localscript, you should be able to change their properties locally. Thus, in order to change health and name distance for enemies, you could do this:

if Player1.TeamColor ~= Player2.TeamColor then
    Player1.Character.Humanoid.HealthDisplayDistance = 0
    Player1.Character.Humanoid.NameDisplayDistance= 0
end

This changes both the enemy player HealthDisplayDistance and NameDisplayDistance locally. Meaning you cannot see it at all, whether there's walls or not. Player1 or Player2 in this instance is the enemy or the player the localscript is in. The "~=" operator checks if the TeamColors are equal (if they aren't, they aren't on the same team).

If there's any more questions you can ask me. But it should be pretty easy to solve the rest of the code in order to differentiate players from other weird objects in the players hierarchy and get the players in a localscript.

Answer this question