AnDReJ98 Posted January 26, 2012 Share Posted January 26, 2012 Hi Guys There is a problem when I choose the skin For example, I chose ID: 46 and i finshed Other players see my skin CJ skin ID: 0 not my skin only me i can see my skin whats problem here? this client side local localPlayer = getLocalPlayer() left = guiCreateStaticImage(0.07,0.60,0.15,0.30,"images/left.png",true) right = guiCreateStaticImage(0.78,0.60,0.15,0.30,"images/right.png",true) function goRight(player) local newSkin = getElementModel (localPlayer) + 1 while not setElementModel (localPlayer,newSkin) do newSkin = newSkin + 1 end end addEventHandler ( "onClientGUIClick",right,goRight, false ) function goLeft(player) local newSkin = getElementModel (localPlayer) - 1 while not setElementModel (localPlayer,newSkin) do newSkin = newSkin - 1 end end addEventHandler ( "onClientGUIClick",left,goLeft, false ) Link to comment
SDK Posted January 26, 2012 Share Posted January 26, 2012 You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. Link to comment
AnDReJ98 Posted January 26, 2012 Author Share Posted January 26, 2012 You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. how? please help me thank you Link to comment
TAPL Posted January 26, 2012 Share Posted January 26, 2012 You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. how? please help me thank you Is this very difficult to understand? or you just waiting for ready code? lazy people! You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. Link to comment
AnDReJ98 Posted January 26, 2012 Author Share Posted January 26, 2012 You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. how? please help me thank you Is this very difficult to understand? or you just waiting for ready code? lazy people! You need to use setElementModel serverside, use triggerServerEvent in the gui script to send the skin to the server. shut up if you have any help help me or go out from topic Link to comment
NeXTreme Posted January 26, 2012 Share Posted January 26, 2012 triggerServerEvent() addEvent() addEventHandler() That's what ya need. I'm not writing the whole code for you though Link to comment
AnDReJ98 Posted January 26, 2012 Author Share Posted January 26, 2012 triggerServerEvent() addEvent() addEventHandler() That's what ya need. I'm not writing the whole code for you though i know all this setElementModel for one skin like this triggerServerEvent ("skin", getLocalPlayer()) addEvent( "skin", true ) function setSkin () setElementModel ( source, 46 ) end addEventHandler ( "skin", getRootElement(), setSkin ) but setElementModel with all skin when Button go right and lift any help Link to comment
Al3grab Posted January 26, 2012 Share Posted January 26, 2012 triggerServerEvent() addEvent() addEventHandler() That's what ya need. I'm not writing the whole code for you though i know all this setElementModel for one skin like this triggerServerEvent ("skin", getLocalPlayer()) addEvent( "skin", true ) function setSkin () setElementModel ( source, 46 ) end addEventHandler ( "skin", getRootElement(), setSkin ) but setElementModel with all skin when Button go right and lift any help -- Client Side triggerServerEvent ("skin", getLocalPlayer(),getElementModel (getLocalPlayer())) -- Server Side addEvent( "skin", true ) function setSkin (theSkin) if not theSkin then theSkin = math.random(0,100) end setElementModel ( source, theSkin ) end addEventHandler ( "skin", getRootElement(), setSkin ) Link to comment
SDK Posted January 26, 2012 Share Posted January 26, 2012 while not setElementModel (localPlayer,newSkin) do newSkin = newSkin + 1 end triggerServerEvent ("skin", localPlayer, newSkin) This will first find a skin to the left/right, and then send it to the server Edit: ninja Link to comment
AnDReJ98 Posted January 26, 2012 Author Share Posted January 26, 2012 triggerServerEvent() addEvent() addEventHandler() That's what ya need. I'm not writing the whole code for you though i know all this setElementModel for one skin like this triggerServerEvent ("skin", getLocalPlayer()) addEvent( "skin", true ) function setSkin () setElementModel ( source, 46 ) end addEventHandler ( "skin", getRootElement(), setSkin ) but setElementModel with all skin when Button go right and lift any help -- Client Side triggerServerEvent ("skin", getLocalPlayer(),getElementModel (getLocalPlayer())) -- Server Side addEvent( "skin", true ) function setSkin (theSkin) if not theSkin then theSkin = math.random(0,100) end setElementModel ( source, theSkin ) end addEventHandler ( "skin", getRootElement(), setSkin ) this work thanks you so much you are the best scripter 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