Jump to content
  • 0

What's wrong with this script?


KennyChidorie
 Share

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

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

Question

Okay, i'm don't understand scripts, so... maybe someone can help fix it?

 

integer count;

default
{
state_entry()
{
count = 0;
state p;
}
}

state p
{
state_entry()
{
llListen(XXXXX, "Left", "", "Left");
}
listen(integer channel, string name, key id, string message)
{
++count;
if (count > 30)
{
llSetRot(llGetLocalRot() + <0,0, 5.0>);
state p;
}
else
{
llResetScript();
}
}
}

 

ERROR: Type mismatch:

llSetRot(llGetLocalRot() + <0,0, 5.0>);

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi Kenny,

llGetLocalRot() returns a rotation and llSetRot() expects one. In the middle of that, you're adding a vector <0,0, 5.0>. Rotations have four components, not the three of an XYZ vector. I think you'll want to convert your vector to a rotation using llEulerToRot().

Try replacing <0,0, 5.0> with llEulerToRot(<0,0, 5.0>). That should make the error message go away, but still may not produce the results you desire.

Good luck!

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2860 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...