• Gun that temporarily changes player attributes
    0 replies, posted
I'm trying to make a weapon that basically makes the player indestructible for a period of time and then turns him back to normal after that period is through. I've managed the first part already, changing the player once, now I need to make it so the player's attributes return to normal after 45 seconds. Any feedback is greatly appreciated. here's my code (don't worry about the primaryattack(), I'm mostly concerned about the secondaryattack()) [lua] local ShootSound = Sound("weapons/ak47/ak47-1.wav") function SWEP:PrimaryAttack() self:SetNextPrimaryFire( CurTime() + 0.05 ) self:EmitSound( ShootSound ) end local SecSound = Sound("mcmanager/pwntown.wav") function SWEP:SecondaryAttack() self:SetNextSecondaryFire( CurTime() + 47 ) self:EmitSound( SecSound ) self.Owner:SetWalkSpeed( 2000 ) self.Owner:GodEnable( 1 ) self.Owner:SetJumpPower( 1000 ) end[/lua]
Sorry, you need to Log In to post a reply to this thread.