brocky Posted November 2, 2015 Share Posted November 2, 2015 Hi, I need some help with something like, A memo that lets you change your skin. I don't know how people set a memo to work with an event like "Please Input the skin Id : "The Skin Id(Memo)"" and then you click ok and you get the skin of id you just wrote in the memo. I need an understable code with some comments because I am pretty newbie. If you are confused in what I said please reply below. Link to comment
t3wz Posted November 2, 2015 Share Posted November 2, 2015 I made an example using edits (which is the gui element made for this): guiCreateLabel ( 500, 80, 100, 50, "input the skin ID:", false ) -- create the label, nothing special here editbox = guiCreateEdit ( 500, 100, 100, 50, "", false ) -- create the edit box in the editbox variable setbutton = guiCreateButton ( 500, 160, 100, 50, "Set", false ) -- create a button in the setbutton variable showCursor ( true ) -- show the cursor, now the player is able to write in the edit box function changeskin ( ) local skinid = guiGetText ( editbox ) -- get the text written in the edit box and 'save' it in the skinid variable local number = tonumber ( skinid ) -- convert the skinid variable to a number setElementModel ( localPlayer, number ) -- set the player skin end addEventHandler ( "onClientGUIClick", setbutton, changeskin ) -- add the onClientGUIClick event (which is triggered when the player click on the set button) Hope you understand, ofc if you're going to use this you need to check if the skin is valid etc, this is just an example. 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