MAB Posted August 22, 2015 Share Posted August 22, 2015 how to know if the chat message of a player contains a word? i mean i want to know if the player typed a word between his message to do a function? Link to comment
darhal Posted August 22, 2015 Share Posted August 22, 2015 u mean using a commands ? for e.g: /gc text ? Link to comment
JR10 Posted August 22, 2015 Share Posted August 22, 2015 If you don't mean commands then use onPlayerChat and string.find. Link to comment
darhal Posted August 22, 2015 Share Posted August 22, 2015 if u mean commands use this : function test(plr, cmd, ...) text = table.concat({..}, " ") outputChatBox("Some CHAT :" ..text) end addComandHandler("gc", test) -- FOR EXAMPLE /gc Link to comment
MAB Posted August 22, 2015 Author Share Posted August 22, 2015 JR i need two things from . 1.example about what u r saying 2. your skype / facebook because i need to talk to u in arabic Link to comment
JR10 Posted August 23, 2015 Share Posted August 23, 2015 addEventHandler('onPlayerChat', root, function(msg, type) if (type == 0 and string.find(msg, 'word') then --do something --source here is the player who sent the message end end) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now