Turbe$Z Posted December 10, 2016 Share Posted December 10, 2016 function csunyaszavak(message,messageType) if message == "buzi" or message == "fasz" or message == "geci" or message == "kurva" or message == "baszd" or message == "bazd" or message == "bazmeg" or message == "nyomorék" or message == "csicska" or message == "anyád" or message == "pina" then setPlayerMuted( source, true ) gPlayerMuteTimer[ source ] = setTimer( unmutePlayer, gSettings.muteTime * 1000, 1, source ) outputChatBox( "#14B866[M] #FF699CPlaybot#898395: #808080Ne káromkodj a chaten! (#ffFFff"..getPlayerName(source).."#808080) (mute)", root, 255, 0, 0, true ) end end addEventHandler("onPlayerChat",getRootElement(),csunyaszavak) When i type in chat for example "f*sz", the script mute me. But, when i type for example "te f*sz", the script doesn't mute me. Why? How to fix this? Link to comment
aka Blue Posted December 10, 2016 Share Posted December 10, 2016 Use string.find( message, "f*sz" ) Link to comment
Turbe$Z Posted December 10, 2016 Author Share Posted December 10, 2016 4 minutes ago, aka Blue said: Use string.find( message, "f*sz" ) oh thanks Link to comment
aka Blue Posted December 10, 2016 Share Posted December 10, 2016 (edited) I will make it with table, like this, try it: local swears = { "buzi", "fasz", "geci", "kurva", "baszd", "bazmeg" } for i=1, #swears do local m = swears[ i ] if string.find( message, m ) then end end Edited December 10, 2016 by aka Blue 1 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