noonbr Posted October 20, 2019 Posted October 20, 2019 Boa noite, estou tendo problemas em remover um elemento do lado do cliente, estou usando: function button() local data = getElementData(localPlayer, "abriu") if (data == true ) then outputChatBox("Você já está com o painel aberto.") else setElementData(localPlayer, "abriu", true) buttonss = guiCreateButton(0.5, 0.2, 0.2, 0.05, "Olá Mundo!", true) showCursor(true) end end addCommandHandler("button", button) function hideCursor(button, state, absoluteX, absoluteY) destroyElement(buttonss) showCursor(false) outputChatBox("Olá mundo!") removeElementData(localPlayer, "abriu") end addEventHandler("onClientGUIClick", root, hideCursor) Estava indo tão bem, até porque o setElementData está funcionando corretamente, já o amigo removeElementData não quer funcionar em client-side, alguém pode me ajudar? Agradeço desde já a compreensão :v
main Posted October 21, 2019 Posted October 21, 2019 A função removeElementData é apenas server-side como mostra a wiki: Em vez disto, você pode usar setElementData(localPlayer, "abriu", false).
noonbr Posted October 21, 2019 Author Posted October 21, 2019 Obrigado, se eu utilizar em vez de removeElementData e usar o false ele remove também?
Other Languages Moderators Lord Henry Posted October 21, 2019 Other Languages Moderators Posted October 21, 2019 Porquê se incomoda tanto em remover a data? Sendo que torná-la false terá o mesmo resultado. Você não precisa se preocupar em remover element data do localPlayer, pois quando ele desconectar do servidor, vai ser apagado também.
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