• Knife + whore weapon
    5 replies, posted
Hope someone could do this for me. I have made a knife using the CSS model but i used the lua from a stunstick and it is horrible. Could someone please create a decent shared.lua for my knife. IT NEEDS TO BE 1HIT KILL. gamemodes/darkrp/gamemode/entities/weapons/v_knife_t/shared.lua MODELS SWEP.ViewModel = Model("models/weapons/v_knife_t.mdl") SWEP.WorldModel = Model("models/weapons/w_knife_t.mdl") SOUNDS SWEP.Sound = Sound("sound/weapons/knife_slash1.wav") Sound("sound/weapons/knife_hitwall1.wav"), Sound("sound/weapons/knife_hitwall1.wav") Sound("sound/weapons/knife_hit1.wav"), Sound("sound/weapons/knife_hit2.wav") ====================================== Whore weapon Weapon name:"Suck" Weapon Sound:"garrysmod/sound/slurp.wav" Description: Sucking Time =D
And the reason is? I don't think offering sexual services to mingebags is advisable...
[QUOTE=itak365;17952871]And the reason is? I don't think offering sexual services to mingebags is advisable...[/QUOTE] Because its popular on a DARKRP server i know..
A strange request, but here: [lua] if (SERVER) then AddCSLuaFile("shared.lua"); end; -- Set the icon letter of the SWEP. SWEP.IconLetter = "j"; -- Check if we're running on the client. if (CLIENT) then SWEP.Slot = 3; SWEP.SlotPos = 3; SWEP.DrawAmmo = false; SWEP.DrawCrosshair = false; SWEP.DrawWeaponInfoBox = true; end; function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha) -- Draw the selection icon. draw.SimpleText(self.IconLetter, "CSSelectIcons", x + wide / 2, y + tall * 0.2, Color(255, 245, 10, 255), 1); draw.SimpleText(self.IconLetter, "CSSelectIcons", x + wide / 2 + math.Rand(-4, 4), y + tall * 0.2 + math.Rand(-14, 14), Color(255, 210, 0, math.Rand(10, 120)), 1); draw.SimpleText(self.IconLetter, "CSSelectIcons", x + wide / 2 + math.Rand(-4, 4), y + tall * 0.2 + math.Rand(-9, 9), Color(255, 210, 0, math.Rand(10, 120)), 1); -- Print the information box. self:PrintWeaponInfo(x + wide + 20, y + tall * 0.95, alpha) end -- Set some shared information. SWEP.Author = "The Master"; SWEP.Instructions = "Primary Fire: Suck."; SWEP.Purpose = "Sucking Time"; SWEP.Category = "DarkRP"; SWEP.PrintName = "Whore Weapon"; SWEP.ViewModelFOV = 60; SWEP.ViewModelFlip = false; SWEP.Spawnable = false; SWEP.AdminSpawnable = true; SWEP.NextAttack = 0; SWEP.ViewModel = "models/weapons/v_knife_t.mdl"; SWEP.WorldModel = "models/weapons/w_knife_t.mdl"; -- Set some information for the primary fire. SWEP.Primary.Delay = 0.4; SWEP.Primary.Recoil = 0; SWEP.Primary.Damage = 1000; SWEP.Primary.NumShots = 1; SWEP.Primary.Cone = 0; SWEP.Primary.ClipSize = -1; SWEP.Primary.DefaultClip = -1; SWEP.Primary.NextAttack = 0; SWEP.Primary.Automatic = false; SWEP.Primary.Ammo = "none"; SWEP.DeploySound = Sound("weapons/knife/knife_deploy1.wav") function SWEP:Initialize() if (SERVER) then self:SetWeaponHoldType("melee"); end; -- A table to store the knife sounds. self.hitSounds = { Sound("weapons/knife/knife_hitwall1.wav") }; end; function SWEP:Deploy() self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) self.Weapon:SetNextPrimaryFire(CurTime() + 1) self.Weapon:EmitSound( self.DeploySound, 50, 100 ) return true end -- The primary attack function. function SWEP:PrimaryAttack() self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay); local trace = self.Owner:GetEyeTrace(); local damage = self.Primary.Damage; if (self.Owner:GetPos():Distance(trace.HitPos) <= 80) then if ( ValidEntity(trace.Entity) ) then if (trace.Entity:IsPlayer() or trace.Entity:IsNPC() or trace.Entity:GetClass() == "prop_ragdoll") then self.Owner:EmitSound("garrysmod/sound/slurp.wav"); self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER); if (SERVER) then if trace.Entity:GetClass() != "prop_ragdoll" then if trace.Entity:IsPlayer() then trace.Entity:Kill() end end end else self.Owner:EmitSound( self.hitSounds[ math.random(1, #self.hitSounds) ] ); self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER); -- Draw a decal at the hit position. util.Decal("ManhackCut", trace.HitPos + trace.HitNormal, trace.HitPos - trace.HitNormal); end elseif (trace.Hit) then self.Owner:EmitSound( self.hitSounds[ math.random(1, #self.hitSounds) ] ); self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER); -- Draw a decal at the hit position. util.Decal("ManhackCut", trace.HitPos + trace.HitNormal, trace.HitPos - trace.HitNormal); else self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER); end; else self.Weapon:EmitSound("weapons/iceaxe/iceaxe_swing1.wav"); self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER); end self.Owner:SetAnimation(PLAYER_ATTACK1); end -- The secondary attack function. function SWEP:SecondaryAttack() end; [/lua] Enjoy!
What ones what lol? it looks like you did them together? The whore is seperate from the knife, the whore doesnt even have a knife, it just uses a primary attack as a way to trigger the sound.
[QUOTE=Puni;17995473]What ones what lol? it looks like you did them together? The whore is seperate from the knife, the whore doesnt even have a knife, it just uses a primary attack as a way to trigger the sound.[/QUOTE] Oh, I thought you wanted one weapon for both. Surely you can separate the two? All you need to do is rename the weapon, take out the sound of the slurp and then put that into a new file. If you have any trouble then let me know and I will endeavor to help you.
Sorry, you need to Log In to post a reply to this thread.