|
Pedlar Decosta
Registered User
Join date: 7 May 2007
Posts: 12
|
04-18-2008 03:53
Hi, I am working on a script for a HUD. The menu needs to appear again after a button is selected. I have read various threads on this matter and I just can't see what I am doing wrong. This is the most basic structure of it and I can't even get this working lol. Any help would be appreciated. integer menu_channel = -154287; list menu_main = ["test"];
default { state_entry() { llListen(menu_channel, "", NULL_KEY, ""); } touch_start(integer total_number) { llDialog(llDetectedKey(0), "What would you like to do ?", menu_main, menu_channel); } listen(integer channel, string name,key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) { if (message == "test") { llSay(0,"testing..."); llDialog(llDetectedKey(0), "What would you like to do ?", menu_main, menu_channel); } } } }
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
try this
04-18-2008 04:14
integer menu_channel = -154287; list menu_main = ["test"];
default { state_entry() { llListen(menu_channel, "", NULL_KEY, ""); }
touch_start(integer total_number) { llDialog(llDetectedKey(0), "What would you like to do ?", menu_main, menu_channel); }
listen(integer channel, string name,key id, string message) { if ( id == llGetOwner() ) { if (message == "test") { llSay(0,"testing..."); llDialog( id, "What would you like to do ?", menu_main, menu_channel); } } } }
llDetectedKey(0) works in the scope of the touch event, not in the listen event. llGetOwnerKey(id) will return id, so it is overkill. happy scripting
_____________________
From Studio Dora
|
|
Pedlar Decosta
Registered User
Join date: 7 May 2007
Posts: 12
|
04-18-2008 04:24
Thank you so much Dora  That worked a treat !
|