Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Give 'random' NC on touch script ?

Jimbo Mimulus
Registered User
Join date: 30 May 2008
Posts: 75
10-15-2009 11:22
Hi all,

I'm looking for a script that will give a 'random' notecard when somebody touches an object. There will be no more than 10 notecards in the object and i can name them to suit the script. Any help with this would be most appreciated.

Thanks in advance
Jimbo
_____________________
WhatDoesTheLongButtonAtTheBottomOfTheKeyboardDo?
Steven Broderick
Scripter / Builder
Join date: 14 Sep 2008
Posts: 20
Script.
10-15-2009 11:29
Try this out.

From: someone

default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD,llFloor(llFrand(llGetInventoryNumber(INVENTORY_NOTECARD)))));
}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
llResetScript();
}
}
Jimbo Mimulus
Registered User
Join date: 30 May 2008
Posts: 75
10-15-2009 11:48
Perfect

Thank you very much Steven
_____________________
WhatDoesTheLongButtonAtTheBottomOfTheKeyboardDo?