Hi facepunch,
Sorry in advance if this is a simple question, I am fairly new to coding. I have put a piece of code into a custom DarkRP job so that when you spawn it sets your bodygroups and skin based on our ULX group. Although the skin works fine, the bodygroups seem to be acting up. Any help?
Further explanation:
ULX group,what the bodygroups should be,what the bodygroups are
General 2052001,0020010
Major 1042001,0020010
Commander 1030001,0000010
Major 1120000,1000000
Captain 1101000,1010000
Lieutenant 0111000,1110000
Job code:
TEAM_OFFICER = DarkRP.createJob("Officer", {
color = Color(0, 0, 0, 255),
model = {
"models/player/scifi_male_02.mdl"
},
description = [[You are a comissioned officer of the First Order.]],
weapons = {"weapon_752_de10"},
command = "officer",
max = 10,
salary = 45,
admin = 0,
vote = false,
hasLicense = false,
category = "Non-comabt",
PlayerSpawn = function(ply)
if ply:GetUserGroup() == "General" then
ply:SetBodyGroups("2052001")
ply:SetSkin(2)
elseif ply:GetUserGroup() == "Colonel" then
ply:SetBodyGroups("1042001")
ply:SetSkin(2)
elseif ply:GetUserGroup() == "Commander" then
ply:SetBodyGroups("1030001")
ply:SetSkin(1)
elseif ply:GetUserGroup() == "Major" then
ply:SetBodyGroups("1120000")
ply:SetSkin(1)
elseif ply:GetUserGroup() == "Captain" then
ply:SetBodyGroups("1101000")
ply:SetSkin(1)
elseif ply:GetUserGroup() == "Lieutenant" then
ply:SetBodyGroups("0111000")
ply:SetSkin(1)
end
end,
})
Thanks in advance :smile:.
Sometimes, first bodygroup has the number 1 or 2, so just by test put all your bodygroups on "1111111111111" and test if bodygroups are taken in the game.
If that works, just replace "2052001" by "02052001" if the first bodygroup has the number 1 (you add one 0 at the beginning). Note that the skin is not a Bodygroup, even if it appears in the Bodygroup tab.
Sorry, you need to Log In to post a reply to this thread.