Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

sendChat function in character sheet

New to programming and doing some testing. I'm wondering where my error is in my code. Is this function able to be used within the script tag of a character sheet or only in the API console? <script type="text/worker"> on("sheet:opened", function() { sendChat("Character sheet opened"); }); </script> Any help is appreciated. Thanks, Matt
1535729961
The Aaron
Pro
API Scripter
sendChat() is an API function, you can't call it from a text/worker.  Sheetworkers can only manipulate the contents of the character sheet, they don't have a mechanism to send output to the chat.  The best you could do would be to change a big text block on the character sheet, or possibly set an attribute's value that then is output by a roll button that gets pressed separately.
That is what I thought. Thank you for your help!