Jump to content

Perform a function if detected key is an avatar?


Erallie
 Share

You are about to reply to a thread that has been inactive for 1488 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi. I'm trying to make a script that turns an object into phantom during a collision, only if the object colliding with it is an avatar. Is there a way to make a condition where the function only happens if the detected key or something is an avatar?

Link to comment
Share on other sites

Just banging this one out right here, not testing it in-world as I prolly should, but this should technically work.
This should go inside your collision or collision_start event (make sure to set phantom to 0 in your collision_end event!)

if(llGetAgentSize(llDetectedKey(0)))
{
	llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHANTOM,1]);
} else {
	llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHANTOM,0]);
}

Even if this errors, it should help along to a solution :-)

Edited by Fritigern Gothly
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1488 days.

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
 Share

×
×
  • Create New...