TTT Weapon Reload

Hello guys, i’ve been trying to FIX this “PERK” For TTT but i can’t, the owner of the script won’t give support to it so i guess the only way i can receive help is by some lovely SOUL here on facepunch. haha :slight_smile:



timer.Simple(reloadtime, function()
						if self then
							self.Reloading = false
							if self.Primary.ClipSize < self.Owner:GetAmmoCount(self.Primary.Ammo) then
								local old_clip = self:Clip1()
								self:SetClip1(self.Primary.ClipSize)
								self.Owner:SetAmmo(self.Owner:GetAmmoCount(self.Primary.Ammo) - self.Primary.ClipSize + old_clip, self.Primary.Ammo)
							else
								self:SetClip1(self.Owner:GetAmmoCount(self.Primary.Ammo))
								self.Owner:SetAmmo(0, self.Primary.Ammo)
							end
						end
					end)


After you reload sets your ( Clip ( the one you don’t shoot ) to 0, instead of for example if i have:

Default: 20 bullets, i shoot 3 bullets and i have a clip of 20 it doesnt fit 20-(17) if does 20-0

EDIT:
I’ve change the after “else” for the before “else” information but when you have 15 / 1 ammo and reload it sets your ammo to 16/ 65535 something like that

Sorry for the weird explanation,

EDIT2:

Using http://wiki.garrysmod.com/page/Weapon/DefaultReload will not work, because this is a perk and i guess it should affect all weapons, not an specific one… well idk what im talking x.x

Thanks :smiley:

well owner of that script was selling it on coderhire and if you didint buy it i cant help you.

Coderhire is no longer existent, So I don’t see the problem?

“the owner of the script won’t give support to it so i guess the only way i can receive help is by some lovely SOUL here on facepunch”

x_x read please, i tried to get in contact with Tommy.

I told you, this if then block will never be true. ClipSize doesnt change and primary ammo wont be more than it. Flip your less than < to > and try that instead



if self.Primary.ClipSize &lt; self.Owner:GetAmmoCount(self.Primary.Ammo) then
[/code ]

well i fixsed that error on my server but if tommy didint respond to you you prob didint buy script

Just read and you will get the answer… didint respond all he respond was yes…

Do you think i’ll be that stupid to have a leak addon and ask the OWNER about it to get myself banned ? That’s STUPID. so first of all inform and after that you reply please :facepalm:

Thanks Exho! got it working finally,
Thanks GreenGold for making me laugh.