S3Nn4oX Posted June 24, 2015 Posted June 24, 2015 Hello guys, i have dff and txd files but i need the script to make Skin mod for 1 team can someone help me?
TheSmart Posted June 24, 2015 Posted June 24, 2015 addEventHandler("onClientResourceStart",resourceRoot, function () txd = engineLoadTXD ( "FileName.txd" ) --------- put your fill name engineImportTXD ( txd, 6 ) -------- skin id dff = engineLoadDFF ( "FileName.dff", 0 ) engineReplaceModel ( dff, 6 ) end)
KariiiM Posted June 25, 2015 Posted June 25, 2015 -Client side : Client.lua addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) engineImportTXD ( engineLoadTXD ( "fillname.txd" ) , 288 ) <--Change this skin number "288" and add your skin there. engineReplaceModel ( engineLoadDFF ( "fillname.dff" ) , 288 )< --Same here,also change name to your file name. end ) meta.xml
TheSmart Posted June 25, 2015 Posted June 25, 2015 -Client side : Client.lua addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) engineImportTXD ( engineLoadTXD ( "fillname.txd" ) , 288 ) <--Change this skin number "288" and add your skin there. engineReplaceModel ( engineLoadDFF ( "fillname.dff" ) , 288 )< --Same here,also change name to your file name. end ) addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) engineImportTXD ( engineLoadTXD ( "fillname.txd" ) , 288 ) --Change this skin number "288" and add your skin there. engineReplaceModel ( engineLoadDFF ( "fillname.dff" ) , 288 ) --Same here,also change name to your file name. end ) now it will work
S3Nn4oX Posted June 25, 2015 Author Posted June 25, 2015 I can do that script only for 1 time, that if someone in the group he can use it if he isn't so he cant use it, help me
tuaos Posted June 25, 2015 Posted June 25, 2015 I can do that script only for 1 time, that if someone in the group he can use it if he isn't so he cant use it, help me function skinTeam(oldModel, newModel) local players = getElementsByType ( "player" ) for i,thePlayer in ipairs(players) do if newModel == skinID then -- skinID must be filled with your preferred ID if not isPlayerInTeam(thePlayer, "team Name") then -- set your team name cancelEvent() end end end end addEventHandler("onElementModelChange", root, skinTeam) function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end
tuaos Posted June 30, 2015 Posted June 30, 2015 how i can set Skin ID for this? In the 4th line of lua.. set the skin number instead of skinID. On 5th line set your team name instead of "team name"
S3Nn4oX Posted July 1, 2015 Author Posted July 1, 2015 It's should work now? Client.lua function skinTeam(oldModel, newModel) local players = getElementsByType ( "player" ) for i,thePlayer in ipairs(players) do if newModel == skinID then -- 18 must be filled with your preferred ID if not isPlayerInTeam(thePlayer, "Admin") then -- set your team name cancelEvent() end end end end addEventHandler("onElementModelChange", root, skinTeam) function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end Meta.xml "Skin mod for a group" author="S3Nn4oX" version="1.0.0" type="gamemode" />
tuaos Posted July 2, 2015 Posted July 2, 2015 This is server-sided! So = server.lua. And This does not work if you change skin with freeroam resource! If freeroam, then you have to edit inside that! function skinTeam(oldModel, newModel) local players = getElementsByType ( "player" ) for i,thePlayer in ipairs(players) do if newModel == 18 then if not isPlayerInTeam(thePlayer, "Admin") then cancelEvent() end end end end addEventHandler("onElementModelChange", root, skinTeam) function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end Meta.xml "Skin mod for a group" author="S3Nn4oX" version="1.0.0" type="script" />
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