WiBox Posted October 4, 2018 Posted October 4, 2018 I've a script editor script, it will let me edit scripts in-game, but there's something I'm thinking of, is it possible to make like that in a editor( I don't know what to call it so I'll just describe ): function local if elseif else end while do return break repeat Is it possible so I add those things inside a script editor? I mean those things get written in the blue color... and the math.random in pink.. Because if it possible, I would add it. Because your eyes can focus on those things and...
MIKI785 Posted October 4, 2018 Posted October 4, 2018 In short, yes. But it depends on the approach. If you're using GUI Memo then no, that won't work. If you're using dx then yes, you can make that work (but that would be unnecessarily difficult). I personally think that the best approach here would be to use CEF. It would be very easy to make that happen since there are o lot of open source script editors written in JavaScript for the web, just google it and I'm sure you'll find loads. Lua Scripter Owner of mshost.cz MTA portal.
LilDawage Posted October 10, 2018 Posted October 10, 2018 Yeh why not , and will be better RPG/CnR servers Developer , You want help ? contact me on discord >>>lilDawage#8508<<< i'm at your Service 10/24 hours 7/7 days , >>>Welcome<<< Asking Discord Channel JOIN US ON here , you are welcome 10/24 active
SaNoR Posted October 11, 2018 Posted October 11, 2018 tbl = {"function", "local", "if", "elseif", "else", "then", "end", "print", "math.random", "math.max"} local text = [[function test() local x = 2 if x == 2 then print(x) math.random(1, 10) math.max(2, 9, 1, 4) end end]] addEventHandler("onClientRender", root, function() local color = "#FFFFFF" for i,v in ipairs(tbl) do if text:find(" "..v) or text:find(v.." ") then if i > 0 and i <= 7 then color = "#0000FF" elseif i > 7 then color = "#A6E22D" end text = text:gsub(v, color..v.."#FFFFFF") end end dxDrawText(text, 15, sh/3,_,_,_, 2, "default-bold", "left", "top", false, false, false, true) end) Spoiler 1 1
Gordon_G Posted October 11, 2018 Posted October 11, 2018 @SaNoR why are you giving him the entire script without even explaining ? Gordon#6977
</Mr.Tn6eL> Posted October 11, 2018 Posted October 11, 2018 You should put lines 15-25 outside the render to increase performance skype : 011101000110111000110110011001010110110000110000001110010011000000111001
JeViCo Posted October 13, 2018 Posted October 13, 2018 @SSKE use loadstring function. Example (by Tete omar): loadstring ( "outputChatBox ( \"Hello!\" )" ) you can also color them using string.find + string.gsub function (paste any #FFFFFF color)
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