NeXuS™ Posted August 4, 2017 Posted August 4, 2017 Do you wanna create a script, which block skins for everyone except some users?
itHyperoX Posted August 4, 2017 Author 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
NeXuS™ Posted August 5, 2017 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.
itHyperoX Posted August 5, 2017 Author 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)
NeXuS™ Posted August 5, 2017 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
itHyperoX Posted August 5, 2017 Author 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
NeXuS™ Posted August 5, 2017 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
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