sckatchof Posted March 22, 2012 Share Posted March 22, 2012 hi guys i have a probelm when i click buy skin it dose not change why client side: .... ... addEventHandler ( "onClientGUIClick", Buttonbuyskin, buySkin ) ..... ... .. function buySkin () local soum = 350 local money = getPlayerMoney(localPlayer) if (money < soum) then outputChatBox ( "You dont have enough money!", 225, 0, 0) else local finalSkinID = guiGridListGetItemText ( SkinGrid, guiGridListGetSelectedItem ( SkinGrid ), 2, 1 ) triggerServerEvent("buySkin", getRootElement(), localPlayer, finalSkinID) end end server side : function buyskin ( thePlayer, finalSkinID ) local skinmodel = getElementModel(finalSkinID) getElementModel(thePlayer, finalSkinID) end addEvent ( "buySkin", true ) addEventHandler ( "buySkin", getRootElement(), buyskin ) Link to comment
TAPL Posted March 22, 2012 Share Posted March 22, 2012 --Client side-- addEventHandler("onClientGUIClick", Buttonbuyskin, function() local skinID = guiGridListGetItemText(SkinGrid, guiGridListGetSelectedItem(SkinGrid ),2,1) triggerServerEvent("buySkin", localPlayer, skinID) end) --Server Side-- addEvent("buySkin", true) addEventHandler("buySkin", root, function(skinID) if (getPlayerMoney(source) >= 350) then setElementModel(source,skinID) else outputChatBox("You dont have enough money!",source,225,0,0) end end) Link to comment
sckatchof Posted March 22, 2012 Author Share Posted March 22, 2012 thanxk tapl for help but it dont work Link to comment
TAPL Posted March 22, 2012 Share Posted March 22, 2012 (edited) addEventHandler("onClientGUIClick", Buttonbuyskin, function() local skinID = guiGridListGetItemText(SkinGrid, guiGridListGetSelectedItem(SkinGrid),1) triggerServerEvent("buySkin", localPlayer, skinID) end) Edited March 22, 2012 by Guest Link to comment
sckatchof Posted March 22, 2012 Author Share Posted March 22, 2012 /debugscript 3? skin_c.lua:296: Bad argument @ 'getElementModel 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