Yamil Dagger Posted October 11, 2013 Share Posted October 11, 2013 I know that adding a ! in scripts means "NOT" but how can I use this code and say while NOT flying? Where do I add the ! or how would I put it? if (llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR) Basically I need to detect falling or jumping but not flying. Link to comment Share on other sites More sharing options...
LepreKhaun Posted October 11, 2013 Share Posted October 11, 2013 Yamil Dagger wrote: I know that adding a ! in scripts means "NOT" but how can I use this code and say while NOT flying? Where do I add the ! or how would I put it? if (llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR) Basically I need to detect falling or jumping but not flying. if (llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR && !(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)) // or better integer info = llGetAgentInfo(llGetOwner()); if(info & AGENT_IN_AIR && !(info & AGENT_FLYING)) // alternative way of going about it if (llGetAgentInfo(llGetOwner()) & (AGENT_IN_AIR | AGENT_FLYING) == AGENT_IN_AIR) {ETA: Study https://wiki.secondlife.com/wiki/LSL_Operators to learn the difference between logical and bit-wise operators to see how all this works. Keep in mind that logic operators always result in 1 or 0 (TRUE or FALSE) and bit-wise operators result in non-zero (which is interpreted as TRUE) or zero (FALSE).] 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now