Altier Verwood Posted May 21, 2022 Share Posted May 21, 2022 Hello forums, I have two scripts that talk back and forth at each other, but I can't get the second script to work. Here is the message sent by the first script This script works, it just shouts a region say when touched nameTag = llGetSubString(llGetObjectName(), 0, 6); llRegionSay(-83951,nameTag); llOwnerSay(nameTag); in the second script, the get substring in the listen doesn't seem to work, if i remove that part the script works and it hears the region say. state_entry() { llListen(-83951, "", "", ""); nameTag = llGetSubString(llGetObjectName(), 0, 6); } listen(integer chn, string nam, key id, string msg) { if (chn == -83951 && llGetSubString(msg, 0, 6) == nameTag) Link to comment Share on other sites More sharing options...
KT Kingsley Posted May 21, 2022 Share Posted May 21, 2022 (edited) It works for me using these scripts, where I've filled in some stuff needed for them to compile and run: string nameTag; default { touch_start(integer total_number) { nameTag = llGetSubString(llGetObjectName(), 0, 6); llRegionSay(-83951,nameTag); llOwnerSay(nameTag); } } and string nameTag; default { state_entry() { llListen(-83951, "", "", ""); nameTag = llGetSubString(llGetObjectName(), 0, 6); } listen(integer chn, string nam, key id, string msg) { llOwnerSay ("msg " + msg); if (chn == -83951 && llGetSubString(msg, 0, 6) == nameTag) { llOwnerSay ("!!!"); } } } The only idea I have is that in your case the first seven characters of both object's names are not identical. (In my example both objects were called "Object".) Edited May 21, 2022 by KT Kingsley Link to comment Share on other sites More sharing options...
Altier Verwood Posted May 21, 2022 Author Share Posted May 21, 2022 (edited) Thank you for your reply, wow, i have no idea what changed, but it's working now, thank you for your reply! Edited May 21, 2022 by Altier Verwood Link to comment Share on other sites More sharing options...
Quistess Alpha Posted May 21, 2022 Share Posted May 21, 2022 1 minute ago, Altier Verwood said: I can't have a space in the name of the object for it to work. if you have extra spaces before or after, you'd have to use llStringTrim(); or similar to remove them. 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