Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:sensor_door [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:sensor_door [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Sensor Door ===== | ||
+ | |||
+ | < | ||
+ | // Fixyou Kit's sensor door script with unknown avatar detection. | ||
+ | // Door can be opened by up to 10 avatars, set up by name in the list. | ||
+ | // The door scans for any avatars witin a distance of " | ||
+ | // If known avatars get within a distance of " | ||
+ | //plz IM me if you have questions! Have fun! | ||
+ | |||
+ | //set names of avatars you want to allow access: | ||
+ | string access1 = " | ||
+ | string access2 = " "; | ||
+ | string access3 = " "; | ||
+ | string access4 = " "; | ||
+ | string access5 = " "; | ||
+ | string access6 = " "; | ||
+ | string access7 = " "; | ||
+ | string access8 = " "; | ||
+ | string access9 = " "; | ||
+ | string access10 = " "; | ||
+ | integer distodoor = 3; // set distance (meters) between avatar and door to open | ||
+ | integer scandist = 500; //set scanning distance | ||
+ | string Ava_detected; | ||
+ | integer ava_known = 0; | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | llSensorRepeat("","", | ||
+ | llWhisper(0," | ||
+ | } | ||
+ | |||
+ | sensor(integer total_number) | ||
+ | { | ||
+ | integer x; | ||
+ | for (x = 0; x < total_number; | ||
+ | { | ||
+ | vector pos = llGetPos(); | ||
+ | string Ava_detected = llDetectedName(x); | ||
+ | float diff = llVecDist(pos, | ||
+ | integer dist = llRound(diff); | ||
+ | if(Ava_detected==access1 || Ava_detected==access2 || Ava_detected==access3 || Ava_detected==access4 || Ava_detected==access5 || Ava_detected==access6 || Ava_detected==access7 || Ava_detected==access8 || Ava_detected==access9 || Ava_detected==access10) | ||
+ | { | ||
+ | ava_known = 1; | ||
+ | } | ||
+ | if(ava_known == 0) | ||
+ | { | ||
+ | string detected = Ava_detected + " @ " + ((string)dist) + " | ||
+ | llWhisper(0, | ||
+ | } | ||
+ | if(dist < distodoor) | ||
+ | { | ||
+ | if(ava_known == 1) | ||
+ | { | ||
+ | llWhisper(0, | ||
+ | llPlaySound(" | ||
+ | llSay(0, "Door open for " | ||
+ | llSetPrimitiveParams([PRIM_PHANTOM, | ||
+ | llSleep (15); | ||
+ | llSetPrimitiveParams([PRIM_PHANTOM, | ||
+ | dist = 100; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | llSetPrimitiveParams([PRIM_PHANTOM, | ||
+ | llSay(0, "Sorry " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | no_sensor() | ||
+ | { | ||
+ | llWhisper(0," | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||