Lua Questions, Please Help

I have some LUA questions that I cannot figure out. Please answer them with full meaning of helping and not make a comment.

To introduce, I have a paintball server.


  1. How do I make people on the same team not kill each other?
  2. How do I make it that opposite teams when shooting each other have a 1-hitkill death?
  3. How do I add map voting that occurs every 40 min?
  4. How do I add more maps to the vote?
  5. How do I add an F1 store of where you can buy hats, and trails?
  6. How do you remove the “Null Entity” when I shoot the gun and paint balls fly out?
  7. How do I add F1, 2, 3 or 4 credits to the developers and testers, mappers, etc?
  8. When I choose the teams in the beginning, the box of where I choose the teams will not diapear after 1 click, only when you press “x”, people will abuse, how do I fix this?
    example to 8:

when you join it says, “red team” or “blue team”, and you can click on the panel to choose. But when you click the team, the panel won’t disappear, so you can keep changing teams.

Can you please answer like this,

“1 = add this code to this directory, into this file!”


“1) you do this and that, and it works!”

I need some step by steps instructions if possible because I am not good in that. Just give me directories and file names, and what to do.

Thank you if you have been a major support, thank you for reading!

Sincerely, Snicket

You can add me to help in private here, or you can help me in “team viewer”:

Can someone please help?


if ent:Team() == attacker:Team() then

  1. I can’t get that



  1. Whit “for k,v do” functions

  2. Spare1 and vgui whit derma menus

6)I can’t get that

  1. More spare menu and derma


Where do I place these code texts, and also most of the answered questions I didn’t understand. :\

the 1) and 3) on any file
the 8) con the file which contains panel data

2)[lua] hook.Add(“EntityTakeDamage”,“Opposite Teams 1hitkill”,function(ent,inflictor,attacker,amount,dmginfo)

if ent:Team() != attacker:Team() then
Put that in any serverside file, such as init.lua

I think for question 2 he means how can he make it when a player shoots someone on the opposite team it’s a one hit kill

Okay I dont want to rip on the first guys code, But the first code might produce a error if something other then a player hurts the victim

  1. You can put this in a serverside file like init.lua [lua]hook.Add( “PlayerShouldTakeDamage”, “PB_NoTeamDamage”, function( victim, attacker )
    if attacker:Team() == victim:Team() then return false end

  2. You can put this in a serverside file like init.lua [lua]hook.Add(“ScalePlayerDamage”,“PB_ScaleDamage”, function( ply, hitgroup, dmginfo )
    dmginfo:ScaleDamage( 6 ) --Lol probably overkill but I did it this way on one of my projects. Though my number was way higher and it was my first gamemode so if this is wrong somebody please correct it.

3-4. What map voting system are you using?

  1. Get something like pointshop and put it on F1 in the config file.

  2. We’ll need the code to fix that.

  3. For F1 use **[Gamemode.ShowHelp](**, For F2 use **[Gamemode.ShowTeam](**, For F3 use **[Gamemode.ShowSpare1](**, For F4 use **[Gamemode.ShowSpare2](**

  1. use **[DFrame.Close](**

Just a side note for gonzalolog, I think your looking for the function **[Panel.SetVisible](**


Wow, thank you so much guys! This means so much to me! Do you know where I can get a good map voting system, and also how I can add maps to it?

How do I also set prices for point shop?


How do I add this, that when you kill someone with the paint ball, you gain 10 points, if you get hit, you loose 5. If you win a game, the whole team gets 90. Thank you very much!

sh_items.lua ( You can edit the Cost of each item and add your own )

hook.Add( “PlayerDeath”, “PointShop_PlayerDeath”, function( vic, att, infl )
att:PS_GivePoints( 10, "Killed " … vic:Nick() )
vic:PS_TakePoints( 5, "Died by " … att:Nick() )
end )

I need the function that tells the gamemode the round is over.

Thats the thing, I don’t have it.


How do I make it so that when every round in paintball is 6 min? When 6min is done, the round is over. But during the 6 min match, if you die, you can just spectate till the new round begins. Can someone help me with that?

This is leaning more and more to the request section since you ask for bigger and bigger stuff.
Melonracer has a nice round system, go look that up.

Better try Trouble in Terrorist Town.

Also, you can base your gamemode on fretta for almost everything you asked above.