I tried what Khodin said, and it worked pretty much flawlessly. You could still move and talk and everything. The only thing I see that’s wrong is now the camera treats the hidden player as an object, instead of just going through it.
In case you were wondering, here’s the script:
game:GetService("RunService").RenderStepped:Connect(function()
local plr = game.Lighting.hiddenPlr.Text
if game.Players:FindFirstChild(plr) and script.parent.parent.Name ~= plr then
game.Players[plr]:Destroy()
end
end)
This script is placed in StarterPlayerScripts. Also, the hiddenPlr value defined by a chat command.
I would start by not running this on RunService, use the changed event and just update whenever you make an amendment to who the hidden player should be. Then, once you’ve done that, hold the current hidden player’s player object in a local variable and return it to its previous state on the client whenever your changed function runs.
As for it breaking things such as chat, I can’t say that I can think of any immediate solution as it probably interferes with some portion of the chat’s CoreScript. I think you should probably provide a reproduction and let people tinker with it and see if they can come up with some creative solution - other than that it might be as deep as this goes.
You need to make sure wherever you’re watching the IntValue is also where the IntValue is changing - be sure you aren’t monitoring it from the server, but changing from the client.
I never said changing it on the server, I said monitoring it from the server, and changing it from the client - because it would not replicate. The changed function is fairly simple and there isn’t too much that you could be doing wrong, so catering to FilteringEnabled is one thing to make sure you’re doing.
Either way even if you’re running it on RunService the issue remains that it is interfering with core scripts, which afaik there isn’t an easy way around.
What I did to fix that was make it so that the player is only hidden on the other players’ clients. This lets the player do everything normally, as they are not hidden to themselves.
Yes it works pretty much perfectly. Everyone can see the movement, chat, etc. of the hidden player. Also, I don’t think you would be able to do things like friend and follow people with a custom player list.
Alright. Ill see if it messes with stuff in my game, and if it does I’ll consider making a custom player list. Other than that, this is pretty much solved. Thanks a lot for your help!