Hey there!
I am currently making a character creator script for a fivem server. Therefore I want to make myself invisible for every other player while I am creating my character. I already tried NetworkSetEntityInvisibleToNetwork() but nothing happened. I also triggered this function every frame but I was still visible to other players. I can make a entity invisible with SetEntityVisible() though but after that I cant see myself anymore.
I hope anybody can help me and thanks in advance!
1 Like
You can mess around with the SetEntityAlpha native instead of using the *Invisible* ones. As for your character being visible on your screen and nobody else’s, run a check of some sort to check if the invoking source matches the playerId (or something similar) so it sets the alpha only for others.
1 Like
Best approach is to use routing buckets.
I fixed the problem. Here is my code if somebody is interested:
local playerPed = PlayerPedId()
Citizen.CreateThread(function()
SetEntityVisible(playerPed, false)
while true do
Citizen.Wait(0)
SetEntityLocallyVisible(playerPed)
end
end)
Looking for a way to make the players alpha 50 so they can still see themselves but that does not work with SetEntityLocallyVisible(playerPed) any idea on a fix?