Lalalu Posted November 5, 2016 Posted November 5, 2016 Hola, cómo les va.. quisiera saber como puedo hacer para que en lugar de decir "Player" en la línea número 8, salga el nombre del jugador sin colores ni nada, sólo el nombre del jugador en color blanco, espero sus respuestas: wndMain = { 'wnd', text='Freroasjsadnm', x = 10, y = 210, width = 287, controls = { {'lbl', text='Player', width=100}, {'br'},
Enargy, Posted November 5, 2016 Posted November 5, 2016 (edited) Reemplazalo. {'lbl', text='Player', id="pname", width=100}, Y luego añades esto: addEventHandler("onClientPlayerChangeNick", localPlayer, function(_,nN) guiSetText(getControl("pname"), getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", "")) end ) Edited November 5, 2016 by Gaberiel sintaxis...
#Dv^ Posted November 5, 2016 Posted November 5, 2016 wndMain = { 'wnd', text='Freroasjsadnm', x = 10, y = 210, width = 287, controls = { {'lbl', id= "nombre"}, {'br'}, -------------------- --Agregas esta función function RemoveHEXColorCode( s ) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end --Buscas esta función y agrega esa línea function toggleFRWindow() if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() setControlText(wndMain, 'nombre', RemoveHEXColorCode(getPlayerName(localPlayer))) end end
Lalalu Posted November 5, 2016 Author Posted November 5, 2016 Así? wndMain = { 'wnd', text='sadasd', x = 10, y = 210, width = 287, controls = { {'lbl', id= "nombre"}, {'br'}, function RemoveHEXColorCode( s ) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end function toggleFRWindow() if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() setControlText(wndMain, 'nombre', RemoveHEXColorCode(getPlayerName(localPlayer))) end end
#Dv^ Posted November 5, 2016 Posted November 5, 2016 17 minutes ago, Lalalu said: Así? wndMain = { 'wnd', text='sadasd', x = 10, y = 210, width = 287, controls = { {'lbl', id= "nombre"}, {'br'}, function RemoveHEXColorCode( s ) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end function toggleFRWindow() if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() setControlText(wndMain, 'nombre', RemoveHEXColorCode(getPlayerName(localPlayer))) end end Sí
#Dv^ Posted November 6, 2016 Posted November 6, 2016 ¿Podrías postear el error que te sale en /debugscript?
Lalalu Posted November 7, 2016 Author Posted November 7, 2016 Si probé el de gabriel, pero tampoco sirvió, sale esto: http://prntscr.com/d41v6k
#Dv^ Posted November 7, 2016 Posted November 7, 2016 (edited) Yo lo probé y funciona, sino postea la línea que marca el error, y te ayudaré Y no es Gabriel, aunque suena por poco así :b Edited November 7, 2016 by Slash14
Lalalu Posted November 7, 2016 Author Posted November 7, 2016 kjsd aver por skype te pasaré el f1 para que mires lo que hice
Recommended Posts