• How to check if a player is cloaked in ULX?
    2 replies, posted
How do you check if a player is cloaked with ULX admin mod? I am trying to make text above a user's head not show if they are cloaked but I am having trouble finding out how to check if a user is cloaked or not.
You can find the ulx cloak command [URL="https://github.com/TeamUlysses/ulx/blob/b7adea4fed9d3b582dabc3db5d198cbda899b2a7/lua/ulx/modules/sh/fun.lua"]here[/URL] ulx cloak uses ULib.invisible which you can find [URL="https://github.com/TeamUlysses/ulib/blob/e003c7bf9ffb8a4a7ef057a35f04c6ae8d942061/lua/ulib/server/player.lua"]here[/URL] ULib stores whether a player is cloaked or not here (Currently Line 372): [CODE]ply:GetTable().invis = { vis=visibility, wep=ply:GetActiveWeapon() }[/CODE] When the player is unfrozen that table is set to nil. You can tell if a player is invisible or not by checking if the table exists. [CODE]if ply:GetTable().invis then // Some code that you want to run when they're invisible end[/CODE]
Thank you!
Sorry, you need to Log In to post a reply to this thread.