I have a crucial part in my roblox horror game where the player see him/herself lying dead on the floor but due to the way the game is structured i need this to be only visible to that specific player so that if another player (say player b) is next to him, they would not see player a 's avatar, they would see theres (player b's) if that makes sense. whether this event is triggered by touching a part or by the player spawning into the game doesnt really matter. Any help with this would be greatly appreciated.
Well there are several ways to do this, but one way to do it is to make a local script specifically a local script that will turn the avatar transparent except for the actually person, the reason this works is because since Roblox automatically has filtering enabled, if something that affects the server is done by a local script it will only be shown on the client on which the local script is running on, hopefully that helps!.
Make a ServerScript that makes the dead player invisible every part and accessory transparency = 1 and put a LocalScript into starterplayerscripts or startercharacterscripts:
You register game.Players.LocalPlayer.CharacterAdded Then you for example get the head and when the transparency changes and it is 0 then you automatically put the transparency to 0 or 0.5 if you want them to be a ghost and dont forget humanoidrootpart has to be invisible and if accessories dont turn invisible you just have to check if the parts are accessories and then get the parts inside it and turn them visible