Apo Posted October 2, 2016 Share Posted October 2, 2016 hey guys. i have a ( for ). i put an outputchatbox in it but i need only one though i get 10x outputchatboxes. function cout(thePlayer) local id = tonumber(getElementData(thePlayer,"ids")) for x=1 , 10 then if x == id then outputChatBox("yes") -- فی المکان end end end addCommandHandler("cout",cout) Link to comment
Mr.Loki Posted October 2, 2016 Share Posted October 2, 2016 function cout(thePlayer) local id = tonumber(getElementData(thePlayer,"ids")) for x=1 , 10 do if x == id then outputChatBox("yes") -- فی المکان end end end addCommandHandler("cout",cout) A for loop uses "do" not then try this Link to comment
Apo Posted October 2, 2016 Author Share Posted October 2, 2016 copy and paste my code agin i need 1 repeat output chat box in the (for x= 1 , 10 do ,....) Link to comment
pa3ck Posted October 2, 2016 Share Posted October 2, 2016 loki didn't just copy your code, he fixed your for loop. Check line 3 in your and his code. 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