• MiniGun SWEP Lua Help
    8 replies, posted
Hi. I have a minigun that is OP, but the damage and firerate are fine. I was just wondering if someone could tell me if there is a way for the person who has it to be auto killed after 45secs of equip, and also not be able to switch weapons once in the minigun slot. Thanks - Tobias
Haven't tested it, but it should work. [lua] function SWEP:Equip() timer.Simple(45,function() if self.Owner then self.Owner:Kill() end end) end [/lua] Just throw it inside of the weapons init file, if the function already exists then just insert the code I gave you.
ok thanks! [editline]14th April 2013[/editline] What about getting ride of it from the map after the person that bought it dies? And also not being able to switch weapons after equip?
Make SWEP:Holster() return false.
ok thanks [editline]14th April 2013[/editline] But when the person wither dies/auto slain the minigun will drop to the ground and someone could pick it up
Like it will auto slay the person than the next person to pick it up will get slayed 1 second later
[lua] function SWEP:OnDrop() if( SERVER )then self:Remove() end end [/lua]
The auto slay doesn't work, it will kick everyone for LUA. Here is the error Timer Failed! [Simple][@gamemodes/terrortown/entities/weapons/weapon_ttt_minigun/shared.lua (line 25)] D
Why do you have two threads?
Sorry, you need to Log In to post a reply to this thread.