ikvindmooi Posted June 4, 2014 Share Posted June 4, 2014 Hello guys, I got a problem because I'm trying to create a button which will allow you to hide your tag and show it. But it doesn't work, there's also no debug or error. Can someone maybe help me? PS: To check if it's even working I've added a outputchatbox, and the only thing it was saying is 'Tags Showing' but not Tag's hiding. function onPanelHideTagButtonClicked ( btn, state) if btn ~= "left" or state ~= "up" then return end if setPlayerNametagShowing ( player, true) then setPlayerNametagShowing ( player, false) outputChatBox('Tags Hiding') else setPlayerNametagShowing ( player, true) outputChatBox('Tags Showing') end end panel.btn.hidetag = guiCreateButton(643, 358, 745, 386, "", false) guiSetAlpha(panel.btn.hidetag, 0) guiSetVisible(panel.btn.hidetag, false) addEventHandler("onClientGUIClick", panel.btn.hidetag, onPanelHideTagButtonClicked, false) I also got a question 2: I want also a button to hide my blip and show it again. I've searched around but couldnt find it, Can someone who can explain me or show me? Thanks in advance, Held. Link to comment
Den. Posted June 4, 2014 Share Posted June 4, 2014 (edited) Try this instead: function onPanelHideTagButtonClicked ( btn, state) if button == 'left' and state == 'up' then setPlayerNametagShowing(localPlayer, not isPlayerNametagShowing(localPlayer)) -- set the nametag visibility to exactly the opposite of the current visibility. end end The issue was on line 3, you used setPlayerNametagShowing in the if condition instead of isPlayerNametagShowing. As for the blip, You will need to find the script where it is defined, and then use setElementVisibleTo(blip, root, false) to hide it completely. Edited June 4, 2014 by Guest Link to comment
ZL|LuCaS Posted June 4, 2014 Share Posted June 4, 2014 I had not seen your response Den 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