im just trying to to play a sound through a plugin when the command is executed but whenever i try using server.RunCommand() it errors saying 'attempt to call a nil value'
here is an image of the code https://prnt.sc/L266LJR4902J
cheers
#adonis plugin server.RunCommand
1 messages · Page 1 of 1 (latest)
that's because RunCommand doesn't exist under the server table; it's supposed to be server.Admin.RunCommand
You didn't define the server variable to something other than a nil value!
As long as what have Expertcoderz said, too.
How would I do that?
put an argument in the function brackets lets say Vargs, then define the server variable as Vargs.server.
Okay cheers I’ll try it when I’m home
That's not strictly necessary since Adonis automatically assigns it in the function env
otherwise the error message would be "attempt to index nil with RunCommand" instead of "attempt to call a nil value" as in this case
Ooh, sorry didn't know that!
Changed my code to this, and added server.Admin.RunCommand as suggested and it doesnt error anymore but it just does nothing. no message appears and no errors or anything in the output
add the settings Prefix :message
It works