I've tried many different lua plugins for the answers but none seem to work for what I need it for or It isn't simple enough for me to grasp. What I think is the argument is sent into a table and read from there for the 1st issue.
1. Basically I need a function that outputs messages depending on the result so if someone types /test it outputs specific data and if someone typed /test 1 another set of data.
2. Another is I need something like
but obviously this doesn't work so I'm not sure how to get customisable coloured text like that.Code:function PLUGIN:cmdTesty(player) rust.SendChatMessage(player, "<color="/self.Config.TopColor/">", self.Config.TopMsg, "</color>") end
I appriciate the help I've been given in the past and I'm always trying to implement low level ideas like this.
Some lua problems.
Discussion in 'Rust Development' started by JohnRU, Aug 8, 2015.
-
Wulf Community Admin
For the first, you'd need to hook into OnRunCommand and listen for the specific command.
For the second, you aren't inserting the config variable properly.
Code:function PLUGIN:cmdTesty(player) rust.SendChatMessage(player, "<color=" .. self.Config.TopColor .. ">" .. self.Config.TopMsg .. "</color>") end -
I tried
based off the pm plugin but it don't work. What am i missing?Code:function PLUGIN:cmdTesty(player, _, args) if not player then return end local which = args[1] if which == "" then rust.SendChatMessage(player, "main") return end end -
Wulf Community Admin
args[0] would actually be the first arg if you are only using one.
Code:function PLUGIN:cmdTesty(player, cmd, args) if not player then return end if args[0] == "hello" then rust.SendChatMessage(player, "hello") return end end
