UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Set object visible/invisible to player explained.

broken avatar :(
Created 2 years ago
by gympie6
0 Members and 1 Guest are viewing this topic.
351 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 5 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
In case you want to make something visible to two players,
would it be something like this?:
Code Snippet
Plaintext
card = spawn("script_model", something.origin);

players = get_players();

card SetVisibleToPlayer(players[0]);
card SetVisibleToPlayer(players[1]);

card SetInvisibleToPlayer(players[2]);
card SetInvisibleToPlayer(players[3]);
No, only the second player is able to see the card.
 
This is how it should be done:
Code Snippet
Plaintext
card = spawn("script_model", something.origin);

players = get_players();

card SetInvisibleToPlayer(players[0], false);
card SetInvisibleToPlayer(players[1], false);

card SetInvisibleToPlayer(players[2]);
card SetInvisibleToPlayer(players[3]);
The functions explained:
Code Snippet
Plaintext
- SetVisibleToPlayer(player): object is ONLY visible to that player.
 
- SetInvisibleToPlayer(player, false): object is visible to player.
 
- SetInvisibleToPlayer(player): object is NOT visible to player.
This also counts for the fx playing on that script_model. If you hide the object it is no longer visible to the player.
When you show the script_model again the fx that is being played is gone.
The only current way to show the fx is delete the script_model and play the fx on the script_model again.
 
Cod is wonderful sometimes. :facepalm2:
Last Edit: September 20, 2022, 08:38:26 pm by gympie6

 
Loading ...