HG Snuuk Posted September 29, 2019 Share Posted September 29, 2019 Opa bom eu consigui fazer um sisteminha que identifica quando o player ativa o voice porem eu gostaria fazer quando ele ativar desabilitar o dxtext "desativado" , para que fique apenas o "ativado" local fala = dxDrawText("Desativado", x*500, y*100, x*1132, y*37, tocolor(255, 0, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) if (getElementData(localPlayer, "falando")) then fala2 = dxDrawText("Ativado", x*500, y*100, x*1132, y*37, tocolor(0, 255, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) end -------------- addEventHandler ( "onClientPlayerVoiceStart", root, function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", true); end end ); addEventHandler ( "onClientPlayerVoiceStop", root,function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", false); end end); Link to comment
root. Posted September 29, 2019 Share Posted September 29, 2019 -- Clientside addEventHandler("onClientRender",root, function() local fala = getElementData('falando') or false if fala == true then dxDrawText("Ativado", x*500, y*100, x*1132, y*37, tocolor(0, 255, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) else dxDrawText("Desativado", x*500, y*100, x*1132, y*37, tocolor(255, 0, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) end end ) addEventHandler ( "onClientPlayerVoiceStart", root, function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", true); end end ); addEventHandler ( "onClientPlayerVoiceStop", root,function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", false); end end); 1 Link to comment
HG Snuuk Posted September 29, 2019 Author Share Posted September 29, 2019 8 hours ago, Rut said: -- Clientside addEventHandler("onClientRender",root, function() local fala = getElementData('falando') or false if fala == true then dxDrawText("Ativado", x*500, y*100, x*1132, y*37, tocolor(0, 255, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) else dxDrawText("Desativado", x*500, y*100, x*1132, y*37, tocolor(255, 0, 0, 221), 1.00, font, "left", "top", false, false, false, true, false) end end ) addEventHandler ( "onClientPlayerVoiceStart", root, function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", true); end end ); addEventHandler ( "onClientPlayerVoiceStop", root,function() if (source and isElement(source) and getElementType(source) == "player") and localPlayer == source then setElementData(source, "falando", false); end end); esta como desativado porem quando ativo o voice ele n troca e no debug esta dando erro nessa linha local fala = getElementData('falando') or false erro debug :bad argumente @ 'getElementData' [Expected element at argument 1, got string 'falando'] Link to comment
Eficiencia Posted September 29, 2019 Share Posted September 29, 2019 Esqueceu de especificar o elemento local fala = getElementData(localPlayer, "falando") or false 1 Link to comment
root. Posted September 29, 2019 Share Posted September 29, 2019 2 hours ago, HG Snuuk said: esta como desativado porem quando ativo o voice ele n troca e no debug esta dando erro nessa linha local fala = getElementData('falando') or false erro debug :bad argumente @ 'getElementData' [Expected element at argument 1, got string 'falando'] Esqueci de especificar o item, desculpe como o usuário acima colocou: local fala = getElementData(localPlayer,'falando') or false 1 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