TorNix~|nR Posted October 28, 2017 Share Posted October 28, 2017 (edited) Guys, I need help on this little script! I want a cancelEvent when the skin id is: 308 function tt() triggerServerEvent( "setplayermask", localPlayer, "zombie") if getElementModel( source ) == 308 then cancelEvent() end end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), tt) Edited October 28, 2017 by TorNix~|nR Link to comment
Moderators IIYAMA Posted October 28, 2017 Moderators Share Posted October 28, 2017 Is(And to which skin afterwards?) OR on skin changed? Your code doesn't make sense and should be serverside to prevent de-sync. Link to comment
TorNix~|nR Posted October 28, 2017 Author Share Posted October 28, 2017 function maske_ekle(name) if obje[source] then destroyElement(obje[source]) end local objeid = maskTable[name][1] local bodyattach = maskTable[name][2] local zROT = maskTable[name][3] obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 ) exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,0,0,-0.61,0,0,zROT) if getElementModel( source ) == 308 then cancelEvent() end end addEvent("setplayermask",true) addEventHandler("setplayermask", root, maske_ekle) this is the server-side Link to comment
Moderators IIYAMA Posted October 28, 2017 Moderators Share Posted October 28, 2017 (edited) The event you cancelled has no relationship with changing the skin, so that will not work. Use, over cancelEvent(). setElementModel( source, 0 ) And this part is incorrect: function tt() triggerServerEvent( "setplayermask", localPlayer, "zombie") if getElementModel( source ) == 308 then cancelEvent() end end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), tt) Edited October 28, 2017 by IIYAMA Link to comment
TorNix~|nR Posted October 28, 2017 Author Share Posted October 28, 2017 Done! thank you I found the solution. 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