xXMADEXx Posted March 16, 2013 Share Posted March 16, 2013 How can i make the script below, so that when the box shows, it will stay on the message, and not generate through all of them? messages = { {"Enjoy Your Stay "}, {"Website:\n[url=http://www.rog-mta.tk]http://www.rog-mta.tk[/url]"}, {"Have Fun, Or Be Punished!"} } function genorateMessage() return unpack(messages[math.random(#messages)]) end function dxRectangle() dxDrawRectangle(998, 285, 275, 487, tocolor(0, 0, 0, 150), true) dxDrawLine(998, 286, 998, 774, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(996, 772, 1270, 772, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(996, 285, 1270, 285, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1270, 284, 1270, 772, tocolor(255, 255, 255, 255), 1, true) dxDrawText("INFORMATION", 1008, 296, 1262, 328, tocolor(255, 255, 255, 255), 2, "default-bold", "center", "top", false, false, true, false, false) dxDrawLine(996, 348, 1270, 348, tocolor(255, 255, 255, 255), 1, true) dxDrawText(genorateMessage(), 1018, 352, 1249, 753, tocolor(255, 255, 255, 255), 1.5, "default", "left", "top", false, false, true, false, false) end setTimer( function () addEventHandler("onClientRender",root,dxRectangle) setTimer( function () removeEventHandler("onClientRender",root,dxRectangle) end, 10000, 1 ) end, 15000, 0 ) Link to comment
Castillo Posted March 16, 2013 Share Posted March 16, 2013 messages = { {"Enjoy Your Stay "}, {"Website:\n[url=http://www.rog-mta.tk]http://www.rog-mta.tk[/url]"}, {"Have Fun, Or Be Punished!"} } currentMessage = "" function genorateMessage() return unpack(messages[math.random(#messages)]) end function dxRectangle() dxDrawRectangle(998, 285, 275, 487, tocolor(0, 0, 0, 150), true) dxDrawLine(998, 286, 998, 774, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(996, 772, 1270, 772, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(996, 285, 1270, 285, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1270, 284, 1270, 772, tocolor(255, 255, 255, 255), 1, true) dxDrawText("INFORMATION", 1008, 296, 1262, 328, tocolor(255, 255, 255, 255), 2, "default-bold", "center", "top", false, false, true, false, false) dxDrawLine(996, 348, 1270, 348, tocolor(255, 255, 255, 255), 1, true) dxDrawText(currentMessage, 1018, 352, 1249, 753, tocolor(255, 255, 255, 255), 1.5, "default", "left", "top", false, false, true, false, false) end setTimer( function () addEventHandler("onClientRender",root,dxRectangle) setTimer( function () removeEventHandler("onClientRender",root,dxRectangle) end, 10000, 1 ) currentMessage = genorateMessage() end, 15000, 0 ) Link to comment
xXMADEXx Posted March 16, 2013 Author Share Posted March 16, 2013 Text isn't coming out. Link to comment
Castillo Posted March 16, 2013 Share Posted March 16, 2013 Oh yeah, fixed it, copy it again. Link to comment
xXMADEXx Posted March 16, 2013 Author Share Posted March 16, 2013 Castillo, my hero <3 Link to comment
Anderl Posted March 16, 2013 Share Posted March 16, 2013 Use local variables whenever possible. 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