Infernus Posted May 21, 2011 Posted May 21, 2011 Hi Guys ,, I Have Problem in My script ,, it show random math problem Every 5 Sec ,, and players can answer by chat but the script doesn't work i don't know why my code : function mp() n1 = math.random(1,3) n2 = math.random(1,3) na = n1*n2 outputChatBox("The Math Problem Is "..n1.." X "..n2.." = ?") end setTimer(mp,5000,0) function onChat ( message, messageType ) if message == na then outputChatBox("Good Job") end end addEventHandler ("onPlayerChat",getRootElement(),onChat) no errors in /debug script 3 can anyone help me ? Sorry For My Bad English
karlis Posted May 21, 2011 Posted May 21, 2011 have to be serverside function mp() n1 = math.random(1,3) n2 = math.random(1,3) na = n1*n2 outputChatBox("The Math Problem Is "..n1.." X "..n2.." = ?") end setTimer(mp,60000,0) --u don't want every 5sec, do you?i put 1minute function onChat ( message, messageType ) if tonumber(message) == na then outputChatBox("Good Job") end end addEventHandler ("onPlayerChat",getRootElement(),onChat)
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