No, that would control invisibility for specific clients, not players. On those clients it would either not be invisible to all players, or be invisible to all players. It will also more than likely cause the clients to OOS if used in combat.Yes, using GetLocalPlayer().
A very shitty way of only making it invisible for a player:
Give the unit the invisibility ability.
Then for all the players that should be able to see the invisible unit, make give them the true sight ability to their units. You can use a spellbook to hide the icon if you want.
For the player who should not see the invisible unit, simply do not give the true sight ability to hen.
You can have allies without sharing vision.Might work in an ideal world where no players ally with each other.
A very shitty way of only making it invisible for a player:
Give the unit the invisibility ability.
Then for all the players that should be able to see the invisible unit, make give them the true sight ability to their units. You can use a spellbook to hide the icon if you want.
For the player who should not see the invisible unit, simply do not give the true sight ability to hen.
Invisibility is a flag. It affects either all players (on) or no players (off). As such it is not possible.
However, you could reveal it for all but specific players. If you give all other players detection of the unit then it will be "invisible" as far as the flag is concerned but not invisible to those players.
Yes, using GetLocalPlayer().
No, that would control invisibility for specific clients, not players. On those clients it would either not be invisible to all players, or be invisible to all players. It will also more than likely cause the clients to OOS if used in combat.
You should not use the GetLocalPlayer for this because this affects unit's behavior.
(Yes it does.)
As DSG and LDZ mentioned:
What you could do is make them invisible to all players and for the ones who should see them, you could give those a dummy unit with true sight.
However... why not give that dummy unit a dummy true sight with 1 range?
That dummy will follow the target in a 0.03 interval so it will keep the other in sight.
It will also not show nearby invisible units as the range is too low for that.
That would be the best guess I think...
However, there might be another way to achieve what you want.