Jump to content

gui MEMO problem |


JeViCo

Recommended Posts

Hello everyone! i'm making a login panel and met a little(maybe not) problem. All following letters appear on a new line.

Code:

addEventHandler("onClientCharacter", root, function(key)
	if guiGetVisible(backimg) then
		if string.match(key, '%a') or string.match(key, '%d') then
			if edit_l then
				local text = guiGetText(edit_login)
				--outputChatBox(text)
				--outputChatBox(key)
				guiSetText(edit_login,text..key)
			elseif edit_p then
				local text = guiGetText(edit_pass)
				guiSetText(edit_pass,text..key)
			elseif edit_conf_p then
				local text = guiGetText(edit_conf_pass)
				guiSetText(edit_conf_pass,text..key)
			end
		end
	end
end)

 

Link to comment
  • 3 weeks later...
10 hours ago, Juuve said:

 vertical blinking line still visible\\ even with alpha = 0

try to use this function to delete last character on the text

function deleteLastCharacter(str)
return(str:gsub("[%z\1-\127\194-\244][\128-\191]*$", ""))
end
addEventHandler("onClientCharacter", root, function(key)
	if guiGetVisible(backimg) then
		if string.match(key, '%a') or string.match(key, '%d') then
			if edit_l then
				local text = guiGetText(edit_login)
text=deleteLastCharacter(text)
text=deleteLastCharacter(text)
				guiSetText(edit_login,text..key)
			elseif edit_p then
				local text = guiGetText(edit_pass)
text=deleteLastCharacter(text)
text=deleteLastCharacter(text)
				guiSetText(edit_pass,text..key)
			elseif edit_conf_p then
				local text = guiGetText(edit_conf_pass)
text=deleteLastCharacter(text)
text=deleteLastCharacter(text)
				guiSetText(edit_conf_pass,text..key)
			end
		end
	end
end)

check if is it work or no

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...