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 .
×

Using sendChat in an action button script

Hi, I'm trying to do a simple chat output when a button on the character sheet is clicked : <button type="action" name="act_say">Say something</button> <script type="text/worker"> on('clicked:say', function() { sendChat("Roller", "Youhou"); }); </script> Yet the only thing i have in the console in the end is a  ReferenceError: sendChat is not defined Is there a way to use sendChat there ? Do I neet to access it from another object ?
1587073519
GiGs
Pro
Sheet Author
API Scripter
action buttons cannot send chat messages. They can only change attribute values.  In the same way roll buttons can only send to chat, they cannot change attribute values. Each type of button does only one thing, they cannot be combined. Also sendChat is an API command-  you cant use that in character sheets.