NeXuS™ Posted August 4, 2017 Share Posted August 4, 2017 Do you wanna create a script, which block skins for everyone except some users? Link to comment
itHyperoX Posted August 4, 2017 Author Share Posted August 4, 2017 5 hours ago, NeXuS™ said: Do you wanna create a script, which block skins for everyone except some users? Yes for accountID. Example: My accountID is 1, and i want to add 303 skinID only for my account. So if anybody have that skin, the script change that to 0 Link to comment
NeXuS™ Posted August 5, 2017 Share Posted August 5, 2017 local skinTable = { --[SKINID] = EXCEPTION [301] = 1 } addEventHandler("onElementModelChange", getRootElement(), function(oldModel) local newModel = getElementModel(source) if skinTable[newModel] then if getElementData(source, "acc.accID") ~= skinTable[newModel] then setElementModel(source, oldModel) outputChatBox("That model is prohibited to all users except one.", source) end end end) Try this one out. Link to comment
itHyperoX Posted August 5, 2017 Author Share Posted August 5, 2017 13 hours ago, NeXuS™ said: local skinTable = { --[SKINID] = EXCEPTION [301] = 1 } addEventHandler("onElementModelChange", getRootElement(), function(oldModel) local newModel = getElementModel(source) if skinTable[newModel] then if getElementData(source, "acc.accID") ~= skinTable[newModel] then setElementModel(source, oldModel) outputChatBox("That model is prohibited to all users except one.", source) end end end) Try this one out. Hmm.. Now this working without any debug error, but i can still have the skin. Tried to set the skin instant 1, but didnt work. local skinTable = { --[SKINID] = EXCEPTION [301] = 1 } addEventHandler("onElementModelChange", getRootElement(), function(oldModel) local newModel = getElementModel(source) if skinTable[newModel] then if getElementData(source, "acc.accID") ~= skinTable[newModel] then iprint("ez a skinID accountID -re van védve") setElementModel(source,1) end end end) Link to comment
NeXuS™ Posted August 5, 2017 Share Posted August 5, 2017 Does it output the message? Adding a timer made the whole thing work. local skinTable = { --[SKINID] = EXCEPTION [301] = 1 } addEventHandler("onElementModelChange", getRootElement(), function(oldModel) local newModel = getElementModel(source) if skinTable[newModel] then if getElementData(source, "acc.accID") ~= skinTable[newModel] then outputChatBox("That model is prohibited to all users except one.", source) setTimer(setElementModel, 50, 1, source, oldModel) end end end) 1 Link to comment
itHyperoX Posted August 5, 2017 Author Share Posted August 5, 2017 (edited) Working thank you, how can i add more? Like Tried: local skinTable = { --[SKINID] = EXCEPTION [301] = 1 [50] = 2 [49] = 11 } its flooding the message Edited August 5, 2017 by TheMOG Link to comment
NeXuS™ Posted August 5, 2017 Share Posted August 5, 2017 If you wanna enable the 50 (skinID) to the player whose account ID is 2, then you just do local skinTable = { --[SKINID] = EXCEPTION [301] = 1, [50] = 2 } 1 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