Ulysses

General => Developers Corner => Topic started by: antahz on July 03, 2019, 12:30:47 PM

Title: Question
Post by: antahz on July 03, 2019, 12:30:47 PM
Hello, im making a script, what is the name of the cloak function? Example: "if ply:IsCloaked then"
What is the name of the cloak function?
Title: Re: Question
Post by: Timmy on July 03, 2019, 07:54:55 PM
There is no cloak function in the GLua standard library.

If you have ULib (https://github.com/teamulysses/ulib) installed, you can use ULib.invisible (https://ulyssesmod.net/docs/files/lua/ulib/server/player-lua.html#invisible) in your own scripts.

This is how ULib makes a player invisible: https://github.com/TeamUlysses/ulib/blob/v2.63/lua/ulib/server/player.lua#L363

Checking if a player is cloaked by ULib:
Code: [Select]
if ply:GetTable().invis then
  -- cloaked
else
  -- not cloaked
end

Edit: clarification :P
Title: Re: Question
Post by: JamminR on July 03, 2019, 08:34:28 PM
Ulx use of it
here (https://github.com/TeamUlysses/ulx/blob/8d41a87628a263058003c5f188aff6f86ffc255a/lua/ulx/modules/sh/fun.lua#L322)