Turbe$Z Posted March 6, 2017 Share Posted March 6, 2017 addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) setElementData ( source, oldModel ) end end ) outputChatBox is working fine, but the player can change his skin to 60 no errors/warnings in debugscript How to fix this? Link to comment
Moderators Citizen Posted March 6, 2017 Moderators Share Posted March 6, 2017 You wanted to use setElementModel instead of setElementData : addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) setElementModel ( source, oldModel ) end end ) Link to comment
Turbe$Z Posted March 6, 2017 Author Share Posted March 6, 2017 2 minutes ago, Citizen said: You wanted to use setElementModel instead of setElementData : addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) setElementModel ( source, oldModel ) end end ) i tried this, but still not working Link to comment
Abdul KariM Posted March 6, 2017 Share Posted March 6, 2017 (edited) Where is the newModel ? If you want get a new model , Use getElementModel and Use getElementType Even Skip the bugs Edited March 6, 2017 by Abdul KariM 2 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