Need help with DarkRP

Hello all, i need some help making a new class on DarkRP Version 2.3.7, its setup up with basic classes to begin with but i wanted to make a builder class.

I tried adding this to the Shared.lua file

TEAM_BUILD = AddExtraTeam( “<Builder>”, Color(25, 25, 25, 255), “models/player/alyx.mdl” , [[Builders can be vital to the safety of other RP’ers, they can be paid to work for people and provide some decent protection from gangs. They can also make some income by selling their Tool Gun to others]], { “gmod_tool”,"“weapon_glock2”, “item_ammo_pistol”}, “builder”, 1, 65, 0, false, false) 

After a server restart to see if this had worked all player models were grey men figures. the f4 menu would not work and was just a grey box.

If anyone could help me, by pointing out the problem or suggesting something it would be much apprechiated.

Thanks.

p.s. as you can tell im new to lua scripting so its more than likely to be a lua typo although i tried to script in the same layout as the other classes.

[editline]09:50PM[/editline]

only thing i think i can be is the showteamtables.lua, maybe i need to write something in there

At the bottom of shared.lua is where you put you’re code it says //ADD TEAMS UNDER THIS LINE:

The code would look like this



AddExtraTeam( "Builder", Color(25 25 25, 255), "models/player/alyx.mdl" , [[Builders can be vital to the safety of other RP'ers, they can be paid to work for people and provide some decent protection from gangs. They can also make some income by selling their Tool Gun to others]], { "gmod_tool","weapon_glock"}, "builder", 1, 65, 0, 0,  false)

It should be something like that and remember to put it at the bottom of you’re shared.lua!

Another thing you only need to edit shared.lua to make classes

[lua],"“weapon_glock2”[/lua]
should be
[lua],“weapon_glock2”[/lua]

That broke your script and caused everyone to go back to the default playermodel.

Thanks for quick reply guys, ill edit script to check this out.

And just a note, i m putting this at the bottom of shared.lua and will make new classes as and when i get this working. Will comment again to see the results.

[editline]11:20PM[/editline]

Hmm, i edited the glock thing to both “weapon_glock2” and “weapon_glock” but same problem on the server.

The Error it produces is "
DarkRP\gamemode\showteamtabs.lua:437: bad argument #1 to ‘ipairs’ (table expected, got nil)"

P.s. Just to make sure its still not the shared.lua code, This is what im now using.

AddExtraTeam( “Builder”, Color(25 25 25, 255), “models/player/alyx.mdl” , [[Builders can be vital to the safety of other RP’ers, they can be paid to work for people and provide some decent protection from gangs. They can also make some income by selling their Tool Gun to others]], { “gmod_tool”,“weapon_glock”}, “builder”, 1, 65, 0, 0, false)

AND

TEAM_BUILD = AddExtraTeam( “Builder”, Color(25 25 25, 255), “models/player/alyx.mdl” , [[Builders can be vital to the safety of other RP’ers, they can be paid to work for people and provide some decent protection from gangs. They can also make some income by selling their Tool Gun to others]], { “gmod_tool”,“weapon_glock”}, “builder”, 1, 65, 0, 0, false)

[editline]11:21PM[/editline]

note that im not using both of these Codes, but i have tried both.

[editline]11:39PM[/editline]

GOOD NEWS, got it working. The only other thing that was wrong with it was that the colour “(25 25 25, 255)” was already in use by the mobboss.

One more question i do have is, “does anyone know the Colour code for Yellow?” i ask this because i dont think this is in use by any other class and at the moment im stuck with a color very close to the mobboss colour, Not a big problem. Just wanted to make it clearer.

Thanks for the help.

I looked over that code 12 times until I realized that you forgot the commas in Color(). Try this code out, it should work.


TEAM_BUILDER = AddExtraTeam("Builder", Color(25, 25, 25, 255), "models/player/alyx.mdl", [[Builders can be vital to the safety of other RP'ers, they can be paid to work for people and provide some decent protection from gangs. They can also make some income by selling their Tool Gun to others]], {"gmod_tool","weapon_glock"}, "builder", 1, 65, 0, false, false)

yeah i also figure that out when i re’scripted it.

But all is well now, just need the colour code for yellow :stuck_out_tongue:

Thanks for taking a look at this anyhow. would of had a clue with you lot lol.

Glad to hear you figured this out. The color code for yellow would be Color(255, 255, 0, 255).The color format is Red, Green, Blue, Alpha. There are many available color swatches on the internet, just search around for one that prints RGB values.

Thanks for yellow Code :stuck_out_tongue: