[DiscordArchive] why is that?
[DiscordArchive] why is that?
Archived author: Honey • Posted: 2022-12-25T20:33:38.811000+00:00
Original source
`unit:CastSpell(unit, 2895, true)`
I don't see any unit variable in your script
Archived author: Honey • Posted: 2022-12-25T20:33:47.761000+00:00
Original source
use event 42
Archived author: Honey • Posted: 2022-12-25T20:34:20.120000+00:00
Original source
https://www.azerothcore.org/pages/eluna/...Event.html
[Embed: Global:RegisterPlayerEvent - Eluna]
API documentation for the Global:RegisterPlayerEvent method in the Eluna engine.
https://www.azerothcore.org/pages/eluna/...Event.html
Archived author: adm • Posted: 2022-12-25T20:36:38.779000+00:00
Original source
so instead of message == command, should be event == command?
Archived author: Honey • Posted: 2022-12-25T20:38:48.202000+00:00
Original source
you need to change `RegisterPlayerEvent` this line with event 18 to 42
Archived author: Honey • Posted: 2022-12-25T20:39:42.767000+00:00
Original source
then change the arguments to match the command event from `(event, player, msg, Type, lang)` to `(event, player, command, chatHandler)`
Archived author: adm • Posted: 2022-12-25T20:49:47.960000+00:00
Original source
something like this?
```local command = "test"
function Test(event, player, command, chatHandler)
if(message == command) then
player:SendBroadcastMessage("You have been buffed!")
end
end
RegisterPlayerEvent(42, Test)```
Archived author: adm • Posted: 2022-12-25T20:51:22.379000+00:00
Original source
or that message == command should change as well?
Archived author: Honey • Posted: 2022-12-25T20:54:20.333000+00:00
Original source
yup
Archived author: adm • Posted: 2022-12-25T20:56:58.249000+00:00
Original source
Sorry I'm a complete noob, when it comes to coding! Should it be:
> (event == command)