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

scripting question

broken avatar :(
Created 10 years ago
by jjbradman
0 Members and 1 Guest are viewing this topic.
2,175 views
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
i only want to know this

Code Snippet
Plaintext
if(!IsDefined

would mean "if "is not" defined"?

so i can make something like this

if ( level.player !IsTouching( lol ) )

thanks for your attention :)
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Code Snippet
Plaintext
if(!IsDefined

if its true

Code Snippet
Plaintext
if(IsDefined

if its not true.
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Code Snippet
Plaintext
if(!IsDefined

if its true

Code Snippet
Plaintext
if(IsDefined

if its not true.

so this would do the trick?
Code Snippet
Plaintext
if ( level.player !IsTouching( lol ) )
are sure the "!" means true?  ???
Marked as best answer by jjbradman 10 years ago
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Code Snippet
Plaintext
if(isDefined(variable))
Checks if the variable is defined. If it is, the code in the if statement runs.

Code Snippet
Plaintext
if(!isDefined(variable))
Checks if the variable is not defined. If it is not defined, the code in the if statement runs.

It means exactly what it would mean if you read it as a sentence. "If variable is defined" and "if variable is not defined".

Code Snippet
Plaintext
!
^ means "if not".

Code Snippet
Plaintext
if(!player isTouching(trigger))
would mean "If player is not touching trigger".

The ! has to go at the beginning of the return statement when you use a function that has to be called on an entity, like isTouching().
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
lol thanks again trem :D

 
Loading ...