opnaiC Posted September 28, 2017 Share Posted September 28, 2017 Hi guys, I made a chatbox script myself and all is working perfectly with no errors or warnings in /debugscript 3. I am using a table to save the messages that will be displayed in the chatbox. This is how a part of it looks like: local chatBox = {} function drawChat() for i,v in ipairs (chatBox) do if i < 15 then dxDrawBorderedText(v, 27, 229 - 15*i, 582, 230, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, false, false) end end end addEventHandler("onClientRender", root, drawChat) I have no problems to display the first 14 messages, but now I want the last ( first message) to disappear when there comes a new 15th message. But I have no idea how to script it. So it could be nice if someone could help me. Link to comment
Master_MTA Posted September 28, 2017 Share Posted September 28, 2017 you should make a variable Link to comment
opnaiC Posted September 28, 2017 Author Share Posted September 28, 2017 6 minutes ago, Master_MTA said: you should make a variable I already fixed it myself, there was a problem with the index. But thank you for your answer Link to comment
Master_MTA Posted September 28, 2017 Share Posted September 28, 2017 1 minute ago, opnaiC said: I already fixed it myself, there was a problem with the index. But thank you for your answer any time 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