• a little help
    2 replies, posted
  • i made a simple drop weapon script and when players walk over the weapon they automatically pick the weapon up. is there a way to block players from picking up the weapon by walking over it and instead they have to pick up the weapon by pressing e on the weapon. [highlight](User was banned for this post ("wrong section, undescriptive thread title" - postal))[/highlight]
  • Avatar of brandonj4
  • I found this : [URL="http://www.rabidtoaster.com/scripts/Server%20Side/Scripts/useWeapon.lua"]http://www.rabidtoaster.com/scripts/Server%20Side/Scripts/useWeapon.lua[/URL] Looks like it should work. [lua] local function PlayerCanPickupWeapon( ply, weap ) if ( CurTime() <= ( ply.UseWeaponSpawn or 0 ) ) then return end if ( !ply:KeyDown( IN_USE ) ) then return false end local trace = util.QuickTrace( ply:GetShootPos(), ply:GetAimVector() * 8192, ply ) if ( !trace.Entity || !trace.Entity:IsValid() || trace.Entity != weap ) then return false end end hook.Add( "PlayerCanPickupWeapon", "UseWeapon", PlayerCanPickupWeapon ) local function PlayerSpawn( ply ) ply.UseWeaponSpawn = CurTime() end hook.Add( "PlayerSpawn", "UseWeapon", PlayerSpawn ) [/lua]
  • [QUOTE=brandonj4;35784929]I found this : [URL="http://www.rabidtoaster.com/scripts/Server%20Side/Scripts/useWeapon.lua"]http://www.rabidtoaster.com/scripts/Server%20Side/Scripts/useWeapon.lua[/URL] Looks like it should work. [lua] local function PlayerCanPickupWeapon( ply, weap ) if ( CurTime() <= ( ply.UseWeaponSpawn or 0 ) ) then return end if ( !ply:KeyDown( IN_USE ) ) then return false end local trace = util.QuickTrace( ply:GetShootPos(), ply:GetAimVector() * 8192, ply ) if ( !trace.Entity || !trace.Entity:IsValid() || trace.Entity != weap ) then return false end end hook.Add( "PlayerCanPickupWeapon", "UseWeapon", PlayerCanPickupWeapon ) local function PlayerSpawn( ply ) ply.UseWeaponSpawn = CurTime() end hook.Add( "PlayerSpawn", "UseWeapon", PlayerSpawn ) [/lua][/QUOTE] thank you brandonj4. just what i was looking for