Minka Pearl
Registered User
Join date: 2 Oct 2009
Posts: 29
|
01-12-2010 17:05
I used the simple script in the solvo library to swap textures, problem is anyone can. I want it to be set to just me to touch to swap. Any ideas?
|
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
|
01-12-2010 17:16
Add this test to the touch_start event like this: touch_start (integer total_number) { if (llDetectedKey (0) == llGetOwner ()) { //Texture changing code goes here } }
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-12-2010 17:19
touch_start (integer num) { if(llDetectedKey(0) == llGetOwner()) { // Do whatever it takes to change the texture } else { llInstantMessage(llDetectedKey(0), "Sorry, only the owner can change textures on this object."); } }
Or words to that effect......... ETA: HAH! Pete got there first. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Minka Pearl
Registered User
Join date: 2 Oct 2009
Posts: 29
|
01-12-2010 17:51
this is what i made but it wont run , gives me error. touch_start (integer total_number) { if (llDetectedKey (0) == llGetOwner ()) { //Add script and up to 100 textures to object///
integer number; string name; integer choice = 0;
default { state_entry() { number = llGetInventoryNumber(INVENTORY_TEXTURE); number -= 1; name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "") { llSetTexture(name, ALL_SIDES); choice = choice + 1; } }
touch_start(integer total_number) { if (choice < number) { name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "") { llSetTexture(name, ALL_SIDES); choice = choice + 1; } } else { name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "") { llSetTexture(name, ALL_SIDES); choice = 0; } } } changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } } } }
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-12-2010 18:04
From: Minka Pearl this is what i made but it wont run , gives me error. That's because you didn't incorporate the code that Pete and I gave you. You stuck it outside the script. Do it like this .... integer number; string name; integer choice = 0;
default { state_entry() { number = llGetInventoryNumber(INVENTORY_TEXTURE); number -= 1; name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "") { llSetTexture(name, ALL_SIDES); choice = choice + 1; } }
touch_start(integer total_number) { if (llDetectedKey (0) == llGetOwner ()) { if (choice < number) { name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "" { llSetTexture(name, ALL_SIDES); choice = choice + 1; } } else { name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "" { llSetTexture(name, ALL_SIDES); choice = 0; } } } else { llInstantMessage(llDetectedKey(0), "Sorry, you are not allowed to change textures on this object." ; } } changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } }
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Minka Pearl
Registered User
Join date: 2 Oct 2009
Posts: 29
|
01-13-2010 16:59
thank you all the ones inworld who helped me too. I admit I know nothing of this other than cut pates and hope. It works now very well.  Now if I could just get a linked 2 prim object to spin like a propeller on a airplane, not a helicopter (up down plane not horizontal) I have been able to get a prim to rotate the right way by itself but when linked to say a center hub only the hub spins and not the propeller. Does that make sense at all?
|