获取 llGiveInventory 的结果
Getting the result of llGiveInventory
我有一个 LSL 脚本,它使用 llGiveInventory() 向用户提供一个对象。我的脚本有没有办法知道用户是接受还是拒绝了对象?
在我的查看器 (Firestorm) 中,当我接受给定的对象时,我可以看到一条消息:
"Grid: Primitive owned by Test User gave you Pizza. Primitive is located at MyRegion <107.7737, 137.6579, 23.5>.
该消息甚至出现在对话日志中,因此它似乎显示为一条消息。我尝试在频道 0 和 DEBUG_CHANNEL 上收听,但都没有听到消息。
这是当前脚本:
string objName = "Pizza";
default {
state_entry() {
llListen(DEBUG_CHANNEL, "", NULL_KEY, "");
}
touch_start(integer num_detected) {
llGiveInventory(llDetectedKey(0), objName);
}
listen (integer channel, string name, key id, string message) {
llOwnerSay("Did you hear that? I heard " + message);
}
}
There is no way to know if the transaction failed. Unless you send a message when inventory is given to a prim and prim's script checks its inventory and sends a message back using llRegionSay.
- LSL Wiki
很遗憾,您看不到交易是否成功
我有一个 LSL 脚本,它使用 llGiveInventory() 向用户提供一个对象。我的脚本有没有办法知道用户是接受还是拒绝了对象?
在我的查看器 (Firestorm) 中,当我接受给定的对象时,我可以看到一条消息:
"Grid: Primitive owned by Test User gave you Pizza. Primitive is located at MyRegion <107.7737, 137.6579, 23.5>.
该消息甚至出现在对话日志中,因此它似乎显示为一条消息。我尝试在频道 0 和 DEBUG_CHANNEL 上收听,但都没有听到消息。
这是当前脚本:
string objName = "Pizza";
default {
state_entry() {
llListen(DEBUG_CHANNEL, "", NULL_KEY, "");
}
touch_start(integer num_detected) {
llGiveInventory(llDetectedKey(0), objName);
}
listen (integer channel, string name, key id, string message) {
llOwnerSay("Did you hear that? I heard " + message);
}
}
There is no way to know if the transaction failed. Unless you send a message when inventory is given to a prim and prim's script checks its inventory and sends a message back using llRegionSay. - LSL Wiki
很遗憾,您看不到交易是否成功