crazydudemartijn Posted May 16, 2018 Share Posted May 16, 2018 i have this script it is working but i notice it gives a error when no object is found, and im bad at scripting so i have no clue how to inpliment this line___ if name = "box" say, nothing is here default { touch_start(integer total_number) { string rezName=llGetLinkName(llDetectedLinkNumber(0)); llGiveInventory(llDetectedKey(0), rezName); } } Link to comment Share on other sites More sharing options...
Ipecac Burnham Posted May 16, 2018 Share Posted May 16, 2018 At a glance you're using the names of links in a linkset, as the contents of the prim you are giving?. default { touch_start(integer total_number) { string rezName=llGetLinkName(llDetectedLinkNumber(0)); if(rezName == "box") { llSay(0, "Nothing is here"); } else { llGiveInventory(llDetectedKey(0), rezName); } } } would check the string stored in rezName and "box" for equality. Link to comment Share on other sites More sharing options...
LaurisFashion Posted May 16, 2018 Share Posted May 16, 2018 So you have a scripted object, "Giver", that should give an "Item" when someone touches it. Function llGiveInventory() looks for the Item in the Giver's inventory. The Item needs: to be in the Giver's inventory to have these access rights: Copy, Transfer llGiveInventory() uses two arguments: ID of the target who will receive the Item Name of the Item // Which item do we want to give? string Item = "MyGiftToYou"; default { touch_start(integer touchers) { // Let's check that the item actually is in the inventory: if(~llGetInventoryType(Item)) { // If it is, then give it to the person who touched. llGiveInventory(llDetectedKey(0), Item); } } } 1 Link to comment Share on other sites More sharing options...
crazydudemartijn Posted May 17, 2018 Author Share Posted May 17, 2018 the link shows what it is for i just want no script error when it cant find a item https://gyazo.com/7115628c5ec96b78cecd83857e58ecae Link to comment Share on other sites More sharing options...
crazydudemartijn Posted May 29, 2018 Author Share Posted May 29, 2018 i still havent figured it out anyone ? Link to comment Share on other sites More sharing options...
Xiija Posted May 29, 2018 Share Posted May 29, 2018 (edited) // god i hate these boards... // @LaurisFashion's code should work fine?... touch_start(integer touchers) { string rezName = llGetLinkName(llDetectedLinkNumber(0)); if(rezName == "box") { llSay(0, "Nothing is here"); } else { if(~llGetInventoryType(rezName)) { llGiveInventory(llDetectedKey(0), rezName); } } } Edited May 29, 2018 by Xiija 1 Link to comment Share on other sites More sharing options...
crazydudemartijn Posted May 29, 2018 Author Share Posted May 29, 2018 got the script working with parts of yours xiija thx 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now