Thread: Sending the result into chat
-
April 20th, 2019, 06:42 #1
Sending the result into chat
Hi
I wrote an extension for fortification (some effect in 3.5e, not important now); there is a d100 involved, but for the first version I do not want to try a graphical display of this d100 and, thus, I just use math.number(100). But I would like to send the result of this random number into the Chat (best: to GM only if possible). How can I do this in lua? I always get error messages of different type when I try to use the deliverChatMessage(...) etc.
(If it is important: That is happening while the damage roll is executed)
Thank you in advance
Best,
Kelrugem
-
April 20th, 2019, 06:44 #2
You are using Comm.deliverChatMessage(msg); right?
-
April 20th, 2019, 06:52 #3
Yes, that is what I tried Sorry, forgot the Comm. in my initial post but it was in my code
This is basically what I try:
local rRollFortif = math.random(100);
local msg = {sender = "", font = "emotefont"};
msg = "Fortification roll result" .. rRollFortif;
Comm.deliverChatMessage(msg);
But I get then the error message "deliverChatMessage: Invalid parameter" I guess I define msg somehow wrong
-
April 20th, 2019, 07:01 #4
You need something more like this:
local rRollFortif = math.random(100);
local msg = {sender = "", font = "emotefont"};
msg.text = "Fortification roll result " .. rRollFortif;
Comm.deliverChatMessage(msg);Last edited by damned; April 20th, 2019 at 07:04.
-
April 20th, 2019, 07:15 #5
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks