LucasBaker Posted May 22, 2013 Share Posted May 22, 2013 Well I would like to create a script to do when a player speak some expletive for example! bitch! get out another word as I love Thee what i could use for this? Link to comment
iPrestege Posted May 22, 2013 Share Posted May 22, 2013 addEventHandler "onPlayerChat" string.find cancelEvent ( ) outputChatBox Link to comment
PaiN^ Posted May 22, 2013 Share Posted May 22, 2013 table addEventHandler 'onPlayerChat' string.find cancelEvent string.gsub outputChatBox Link to comment
LucasBaker Posted May 22, 2013 Author Share Posted May 22, 2013 table addEventHandler 'onPlayerChat' string.find cancelEvent string.gsub outputChatBox be so?, did not understand much: \ function schat (root) addEventHandler( "onPlayerChat", rootElement, schat ) string.format (formatstring, '''') cancelEvent () Link to comment
PaiN^ Posted May 22, 2013 Share Posted May 22, 2013 I never said string.format -.-" Create a table with the words you want to stop from showing in the chat, then loop the table with onPlayerChat event and use string.find to check if the message have any words from the table. If it have any cancel the event and output the message and modify the words using string.gsub . 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