scriptina Posted March 6, 2015 Share Posted March 6, 2015 I want to mod the following rezer script in that way, that it rezes random objects instead of the same one all the time. Will that be possible somehow? Do I need to change only this script or the script in one of the 5 target objects I want to be rezed too? default{ touch_start(integer total_number) { vector Pos = llDetectedPos(0); if (llVecDist(Pos,llGetPos()) < 10.0) { rotation Rot = llDetectedRot(0); vector NewPos = Pos + <-0.5,0,0>*Rot; llRezAtRoot("object",NewPos,ZERO_VECTOR, Rot,1); llInstantMessage(llDetectedKey(0),"Please sit down."); } else { llInstantMessage(llDetectedKey(0),"Sorry you are too far away."); } }} Link to comment Share on other sites More sharing options...
Dora Gustafson Posted March 6, 2015 Share Posted March 6, 2015 This resent post is about the same problem. It is about random sounds and not about rezzing random objects but otherwise it is the same :smileysurprised::smileyvery-happy: Link to comment Share on other sites More sharing options...
scriptina Posted March 6, 2015 Author Share Posted March 6, 2015 thank you so much I will try that :matte-motes-grin: Link to comment Share on other sites More sharing options...
Innula Zenovka Posted March 6, 2015 Share Posted March 6, 2015 An alternative way to choose random objects -- not a better way, just an alternative -- is to build a list of inventory objects in state_entry() and then, at run time, say something like string whichObject = llList2String(llListRandomize(ObjectList,1),0); That is, tell LSL to randomise the order of the elements in your list each time you want to rez something, and then pick the first one of the new, randomised, list. Link to comment Share on other sites More sharing options...
scriptina Posted March 7, 2015 Author Share Posted March 7, 2015 That worked fine! I am so happy:) I get all my objects in random order now. Now I just need to know where in the script I can change the postition of the rezed object because it always rezes sideways and a little bit to high. I want it to be rezed on ground and with 90° rotation compared to now. Do I need to set this position in rezzer script or in the object itself or in both? You'd make my day and weekend even if I could work this out Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 7, 2015 Share Posted March 7, 2015 Look in the LSL wiki for the correct syntax for llRezAtRoot. You'll see exactly where to specify the position and rotation of the rezzed object. 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