|
Victor Reisman
Smithy of SL
Join date: 5 May 2006
Posts: 18
|
12-10-2008 11:35
This is what Im trying to acomplish: Running a sensor that goes off when it detects an object and then performs the desired action depending on that objects owner.
Heres what I have:
default { state_entry() { llSensorRepeat("","",AGENT|ACTIVE|PASSIVE,3,PI,0.01); } sensor(integer num) { integer i; for (i = 0;i < num; i++) { if(llGetObjectDetails(llDetectedKey(i),[OBJECT_OWNER]) != llGetOwner()) { Desired action here } } } }
Im getting a type missmatch at the end of if(llGetObjectDetails(llDetectedKey(i),[OBJECT_OWNER]) != llGetOwner())
Please help.
_____________________
Stylize, Revolutionize, Whatever your game is, Second Life is a new world with unlimited potential, and I intend to push the unlimited.
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-10-2008 11:39
From: Victor Reisman llSensorRepeat("","",AGENT|ACTIVE|PASSIVE,3,PI,0.01); A sensor that scans everything nearby every 0.1 seconds!! Ack!! (script) Laaaaaagggg!!! /me hits Victor with a rolled up newspaper. Just use llDetectedOwner instead of llGetObjectDetails(OWNER).
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Victor Reisman
Smithy of SL
Join date: 5 May 2006
Posts: 18
|
12-10-2008 11:52
Thanks, and that was just for testing pourposes, the script will only frun for 10 seconds 
_____________________
Stylize, Revolutionize, Whatever your game is, Second Life is a new world with unlimited potential, and I intend to push the unlimited.
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-10-2008 12:04
Ok then. Still laggy, though..  Back to your original question, you can't compare to a list like that.. You'd need to do something like this: ... list args = llGetObjectDetails(llDetectedKey(i), [OBJECT_OWNER]); key owner = llList2Key (args, 0); if(owner != llGetOwner()) { ...
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
12-10-2008 18:37
Just for fun, create a new prim and a new script:
default { state_entry() { llSetObjectDesc("Just me? " + llGetObjectDesc()); } }
seems nowadays to lead to a description of "Just me? (No Description)"
/esc
_____________________
http://slurl.com/secondlife/Together
|