Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

red alert

Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
04-25-2005 07:13
dang it the scirpt Library dose not work do i will ask my question here
Hello dose anyone have an alarm script like a red alert script where you either say red alert or click on it and it makes the sound play
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-25-2005 07:26
First of all, the Script Library is for compiled code and responses to that code only. Furthermore, it is moderated - meaning your posts will not appear until the moderator (Nada Epoch) adds them. This is the proper forum to ask questions.

For your question, you'll want to use two simple concepts found here and here. This might also help you.

First, let's try a touch-activated sound:

CODE
touch_start(integer total_number)
{
llTriggerSound("Add Sound Name Here",1.0);
}

Fairly simple. Drop the sound file into your object, set the name in the script, and you're rolling. Now if you want it voice activated, by you only...

CODE
state_entry()
{
llListen(0,"",llGetOwner(),""); // llGetOwner returns the owner only
}
listen(integer chan, string name, key id, string msg)
{
if(llToLower(msg) == "red alert") // Makes what was said lower-case and checks it
{
llTriggerSound("Add Sound Name Here",1.0);
}
}

Easy, no?
_____________________
---
Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
04-25-2005 07:28
wow that is easy thanks alot
Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
04-25-2005 10:04
is there anyway to make it loop?
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
04-25-2005 10:12
From: Shadow Keegan
is there anyway to make it loop?

Sounds library calls for LSL :)
_____________________
Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
04-25-2005 10:39
umm it says error when i put the script in it
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
04-25-2005 12:17
It returns an error because those aren't complete scripts. They're just events. You need to encompass them in a default state, for starters. Make a new script. See how it says "touch_start" in there? That defines the touch_start event. Now, see how it's already one tab inside the default{} state? You can just put the events inside there, and they'll work.

I recommend reading the Crash Course page on the LSL wiki. That should explain the basics.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog