#random custom message on aura found

13 messages · Page 1 of 1 (latest)

wintry summit
#

I have a WA that triggers a progress bar when bloodlust is cast. I'd like to add a custom function that shouts a random battle cry. Can anyone help?

compact vortex
#

go to that aura, and then to the "actions" tab

#

and in "on show" you can have it send a chat message or play a sound or whatever it is you want

wintry summit
#

Thanks, but I'm looking for a random action. I've tried this:
function(trigger)
local messages = {"one", "two", "three", "four", "five"}
SendChatMessage(messages[math.random(1,#messages)], "SAY")
return trigger[1]
end

compact vortex
#

You don't declare a function there. And you don't want this in on init, you want it in on show

#

Or in multiple other places in this discord, it's been asked a few times

#

Just do


SendChatMessage(messages[math.random(1,#messages)], "SAY")
wintry summit
#

You did, and now there's a screen capture of where the script goes. Thanks!

compact vortex
#

yes, I'm just wondering why you randomly added stuff that doesn't belong there

wintry summit
#

because I didn't know where it was supposed to go
I came here for help, you helped...thanks 👍

compact vortex
#

I don't mean the place where you put it, but why you didn't just copy and paste it as is (which would've worked just fine), but instead added the function(trigger) and end (which breaks it)