First of all we need to make the dispenser deal or what I am going to call the Parent Item.
Sphere
X: .085
Y: .083
Z .088
Hollow: 90
Rotation
X: 180.
Y: 0
Z: 0
Path Cut
B: 0
E:.500
Then copy it to make the handle.
Use these sizes to the Handle
Sphere
X: .085
Y: .083
Z: .088
Hollow: 90
Rotation:
X: 270
Y: 0
Z: 0
Dimple:
B:.400
E:.450
Link the two pieces together and name it Coffee or what ever you plan on making. I also made the texure blank. You can add your own pattern to it if you wish.
We need to add a script to eat/hold it. Go to the Contents Tab and Click New Script, empty out the default script and add the one below.
[script]
Now take it and wear it and orient it to your hand properly
You can stretch it or shrink it to your liking.
Now you detach the cup. It should be in your inventory click it and copy and paste the cup. Now take the new copied cup (Parent Item) and drop it on the ground. Now from your inventory put the extra Coffee in the Contents of the one you just dropped.
Then add this script to the Parent Item
default
{
touch_start(integer total_number)
{llGiveInventory(llDetectedKey(0), "Coffee");
}
}
This is the touch event to give Coffee:
Then add these scripts to the child item:
string anim ="drink";
string anim2 ="hold_R_handgun";
default
{
attach(key victim)
{
if(victim == NULL_KEY)
{
llStopAnimation(anim);
llStopAnimation(anim2);
llSetTimerEvent(0);
}
else
{
llRequestPermissions(victim,PERMISSION_TRIGGER_ANIMATION);
}
}
run_time_permissions(integer permissions)
{
if (PERMISSION_TRIGGER_ANIMATION & permissions)
{
llStartAnimation(anim);
llStartAnimation(anim2);
llWhisper(0,"Yum!");
llSetTimerEvent(60);
}
}
timer()
{
llStartAnimation(anim2);
llStartAnimation(anim);
}
}
This is the dispenser part of the script, so when you click the Parent Item it will bring down a window to give you the inventory thats inside it.
You can make use to this into anything you want: Candy, cookie, lollypop dispenser.
Of course it doesnt have to be food! It can be anything you want to give out to another AV if they click it. Notecards or Landmarks or pictures.