Pain/Death Station SWEP?

Has anyone found a Pain/Death Station SWEP? I’ve been looking around for awhile and haven’t found a working one.

What is a pain/death station SWEP?

If you would like I can help you with this. Add me on steam click the steam icon under my name.

Have you tried coding one? It’s really easy. Copy the Health Station Entity, and edit 1 line of code, then edit the on-damage section so it logs it as a pain station. For the swep, copy the health station, change it to traitor role can buy, and edit the line which says which entity to spawn. done.


[editline]5th October 2013[/editline]

I have a code actually, Let me know if this works for you.

if SERVER then
   AddCSLuaFile( "shared.lua" )

SWEP.HoldType = "normal"

if CLIENT then
   SWEP.PrintName = "Death Station"
   SWEP.Slot = 6

   SWEP.ViewModelFOV = 10

   SWEP.EquipMenuData = {
      desc="Allows people to die when placed.

Faster recharge. Anyone can use it, and
it can be damaged plus an nasty suprise against vandalism. Can be checked for
DNA samples of its users."

   SWEP.Icon = "VGUI/ttt/icon_health"

SWEP.Base = "weapon_tttbase"

SWEP.ViewModel          = "models/weapons/v_crowbar.mdl"
SWEP.WorldModel         = "models/props/cs_office/microwave.mdl"

SWEP.DrawCrosshair      = true
SWEP.Primary.ClipSize       = -1
SWEP.Primary.DefaultClip    = -1
SWEP.Primary.Automatic      = true
SWEP.Primary.Ammo       = "none"
SWEP.Primary.Delay = 1.0

SWEP.Secondary.ClipSize     = -1
SWEP.Secondary.DefaultClip  = -1
SWEP.Secondary.Automatic    = true
SWEP.Secondary.Ammo     = "none"
SWEP.Secondary.Delay = 1.0

-- This is special equipment

SWEP.CanBuy = {ROLE_TRAITOR} -- only traitors can buy
SWEP.LimitedStock = true -- only buyable once

SWEP.AllowDrop = false

SWEP.NoSights = true

function SWEP:OnDrop()

function SWEP:PrimaryAttack()
   self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
function SWEP:SecondaryAttack()
   self.Weapon:SetNextSecondaryFire( CurTime() + self.Secondary.Delay )

local throwsound = Sound( "Weapon_SLAM.SatchelThrow" )

-- ye olde droppe code
function SWEP:HealthDrop()
   if SERVER then
      local ply = self.Owner
      if not ValidEntity(ply) then return end

      if self.Planted then return end

      local vsrc = ply:GetShootPos()
      local vang = ply:GetAimVector()
      local vvel = ply:GetVelocity()
      local vthrow = vvel + vang * 200

      local health = ents.Create("ttt_explo_station")
      if ValidEntity(health) then
         health:SetPos(vsrc + vang * 10)

         local phys = health:GetPhysicsObject()
         if ValidEntity(phys) then

         self.Planted = true


function SWEP:Reload()
   return false

function SWEP:OnRemove()
   if CLIENT and ValidEntity(self.Owner) and self.Owner == LocalPlayer() and self.Owner:Alive() then

if CLIENT then
   local hudtxt = {text="Click to place the death station", font="TabLarge", xalign=TEXT_ALIGN_RIGHT}
   function SWEP:DrawHUD()
      hudtxt.pos = {ScrW() - 80, ScrH() - 80}
      draw.TextShadow(hudtxt, 2)

function SWEP:Deploy()
   if SERVER and IsValid(self.Owner) then
   return true

function SWEP:DrawWorldModel()

function SWEP:DrawWorldModelTranslucent()

local health = ents.Create("ttt_explo_station")

You may want to give him the entity code as well then

It shows up ingame I just can’t place it anywhere.

And I’m getting this error:
[ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_death_station/shared.lua:107: attempt to call global ‘ValidEntity’ (a nil value)

  1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_death_station/shared.lua:107

So yeah I need the entity code.

Don’t always expect for people to hand out things, but it’s so simple and I had it done so:

If you want end round music this is the one I give out ( Only edit the arrays at the top, don’t edit below except the DEFAULT sound, just pick a sound but it’s really not necessary as long as you have 1 sound in each ):

Do you want detectives to have a radio?

Pretty sure the function now is IsValid, not ValidEntity, but I’m not too sure

Not to be rude, but next time you have an error like this, please do google stuff first and see if you can find your answer before posting here. With basic stuff like this, you may be able to save yourself sometime if you look for it, instead of waiting for posters.

If you place “attempt to call global ‘ValidEntity’ (a nil value)” into google, the first result is a past Facepunch thread and the answer is in the fourth post.

I find this document very useful, anyway:

I already have round end music but thanks!

This death station doesn’t work. It shows up in the menu, you can buy it but it doesn’t place. There aren’t any errors.

  • check if the entity is actually being created in the world, serverside OR clientside. “it doesn’t place” isn’t good enough. find out exactly what’s going on – you have plenty of functions at your disposal.
  • throw print statements into functions related to what you’re doing, like the ENT:Initialize() hook for your SENT, and find out what code is being executed and what isn’t. find the point where it halts where it shouldn’t and find out why.
  • if that fails, look at your console scrollback. there are mistakes that don’t throw up a giant “OH GOD LUA ERRORS” message on your HUD but can still have severe consequences, like when you don’t AddCSLuaFile() a scripted entity.

basic troubleshooting isn’t that complicated.

edit: nvm