When you grant permissions to this script a button will appear on screen that if pressed will send your view into mouselook. The script will (when in mouselook) react to your left mouse button clicks too.
// V1 //
key owner;
default
{
state_entry()
{
owner = llGetOwner();
llRequestPermissions(owner, PERMISSION_TAKE_CONTROLS);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_TAKE_CONTROLS) // Do we have the perms we asked for?
llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE); // This creates a button at the bottom of the screen
else // that if pressed automatically zooms the camera of the owner into mouselook.
llRequestPermissions(owner, PERMISSION_TAKE_CONTROLS);
}
control(key id, integer this, integer that)
{ // Adding various conditions here can change the script behavior in many ways.
llOwnerSay("Click"); // Do stuff when clicking the left mouse button while in mouselook. Like for guns etc.
}
}