• Darkrp Jobs Spawning With Armor.
    9 replies, posted
Hey, I was wondering if anyone knew how to make it so something like a "Juggernaut" job spawns with extra armor for Darkrp. Thanks
if ply:Team() == "Juggernaut" then ply:SetArmor( 100 ) ????
Sorry I'm a pretty big noob. Were would I put this?
under the job, garrysmod/darkrp/gamemode/shared.lua under the right job.
Here's what my job code looks like now [CODE]})TEAM_JUGG = AddExtraTeam("Juggernaut", { color = Color(51, 0, 153, 150), model = "models/juggernaut_player.mdl", description = [[<VIP ONLY> The Juggernaut is just a general badass guy who solves his problems head on. You help the cops by running in, taking hits, and mowing everyone down!]], weapons = {"unarrest_stick", "arrest_stick" , "weapon_mad_m249", "stunstick", "door_ram", "weaponchecker" , "weapon_real_cs_flash" , "weapon_mad_grenade" , "weapon_mad_deagle" , "weapon_radar"}, command = "jugger", max = 2, salary = 90, admin = 0, vote = false, hasLicense = true, NeedToChangeFrom = TEAM_POLICE, if ply:Team() == JUGG then ply:SetArmor( 100 ))}[/CODE] And I get this error [CODE][ERROR] gamemodes/darkrp/gamemode/shared.lua:558: unexpected symbol near 'if' 1. unknown - gamemodes/darkrp/gamemode/shared.lua:0[/CODE] I tried moving around that code, but still end up getting errors. Sorry for me being crappy at this. :/
[lua]TEAM_JUGG = AddExtraTeam("Juggernaut", { color = Color(51, 0, 153, 150), model = "models/juggernaut_player.mdl", description = [[<VIP ONLY> The Juggernaut is just a general badass guy who solves his problems head on. You help the cops by running in, taking hits, and mowing everyone down!]], weapons = {"unarrest_stick", "arrest_stick" , "weapon_mad_m249", "stunstick", "door_ram", "weaponchecker" , "weapon_real_cs_flash" , "weapon_mad_grenade" , "weapon_mad_deagle" , "weapon_radar"}, command = "jugger", max = 2, salary = 90, admin = 0, vote = false, hasLicense = true, NeedToChangeFrom = TEAM_POLICE, customCheck = function(ply) return ply:Team() == JUGG then ply:SetArmor(100))} end[/lua] that should work
[QUOTE=levicheater;39118247][lua]TEAM_JUGG = AddExtraTeam("Juggernaut", { color = Color(51, 0, 153, 150), model = "models/juggernaut_player.mdl", description = [[<VIP ONLY> The Juggernaut is just a general badass guy who solves his problems head on. You help the cops by running in, taking hits, and mowing everyone down!]], weapons = {"unarrest_stick", "arrest_stick" , "weapon_mad_m249", "stunstick", "door_ram", "weaponchecker" , "weapon_real_cs_flash" , "weapon_mad_grenade" , "weapon_mad_deagle" , "weapon_radar"}, command = "jugger", max = 2, salary = 90, admin = 0, vote = false, hasLicense = true, NeedToChangeFrom = TEAM_POLICE, customCheck = function(ply) return ply:Team() == JUGG then ply:SetArmor(100))} end[/lua] that should work[/QUOTE] (Just a question) but would it work? I'm pretty sure the customCheck is being runned every time the F4 menu is being opened? If that's the case, he can re-open the F4 menu to refill Armor and the player will only get Armor when he opens the menu.
how could i do this with giving a job an ammo e.g. give police a siminov ammo [highlight](User was banned for this post ("dumb bump" - postal))[/highlight]
[QUOTE=levicheater;39118247][lua]TEAM_JUGG = AddExtraTeam("Juggernaut", { color = Color(51, 0, 153, 150), model = "models/juggernaut_player.mdl", description = [[<VIP ONLY> The Juggernaut is just a general badass guy who solves his problems head on. You help the cops by running in, taking hits, and mowing everyone down!]], weapons = {"unarrest_stick", "arrest_stick" , "weapon_mad_m249", "stunstick", "door_ram", "weaponchecker" , "weapon_real_cs_flash" , "weapon_mad_grenade" , "weapon_mad_deagle" , "weapon_radar"}, command = "jugger", max = 2, salary = 90, admin = 0, vote = false, hasLicense = true, NeedToChangeFrom = TEAM_POLICE, customCheck = function(ply) return ply:Team() == JUGG then ply:SetArmor(100))} end[/lua] that should work[/QUOTE] This guy is a pro lua king lads
[QUOTE=twitchyb1t;41020995]how could i do this with giving a job an ammo e.g. give police a siminov ammo[/QUOTE] Dat bump + make a new thread, this has already been solved.
Sorry, you need to Log In to post a reply to this thread.