#my swep code dont wanna work (the speed part)

1 messages · Page 1 of 1 (latest)

covert sable
#

AddCSLuaFile()

SWEP.PrintName = "Admin Gun"
SWEP.Author = "envix"
SWEP.Instructions = "A admin gun which gives u speed :D"

SWEP.Spawnable = true
SWEP.AdminOnly = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"

SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true

SWEP.Slot = 1
SWEP.SlotPos = 2
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true

SWEP.ViewModel = "models/weapons/c_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_pistol.mdl"

SWEP.UseHands = true

SWEP.ShootSound = Sound("weapons/pistol/pistol_fire2.wav")

function SWEP:PrimaryAttack()
self:SetNextPrimaryFire(CurTime() + 0.001)
self:ShootBullet(100000000, 1, 0.01)
self:EmitSound(self.ShootSound)
end

function SWEP:SecondaryAttack()

end

function self:Deploy()
local owner = self:GetOwner
owner:SetRunSpeed(owner:GetRunSpeed() * 1000)
return true
end

function self:Holster()
local owner = self:GetOwner
owner:SetRunSpeed(owner:GetRunSpeed() / 1000)
return true
end

#

it goes wrong at function self:deploy and function self:holster

covert sable
# covert sable AddCSLuaFile() SWEP.PrintName = "Admin Gun" SWEP.Author = "envix" SWEP.Instruct...

`AddCSLuaFile()

SWEP.PrintName = "Admin Gun"
SWEP.Author = "envix"
SWEP.Instructions = "A admin gun which gives u speed :D"

SWEP.Spawnable = true
SWEP.AdminOnly = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"

SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true

SWEP.Slot = 1
SWEP.SlotPos = 2
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true

SWEP.ViewModel = "models/weapons/c_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_pistol.mdl"

SWEP.UseHands = true

SWEP.ShootSound = Sound("weapons/pistol/pistol_fire2.wav")

function SWEP:PrimaryAttack()
self:SetNextPrimaryFire(CurTime() + 0.001)
self:ShootBullet(100000000, 1, 0.01)
self:EmitSound(self.ShootSound)
end

function SWEP:SecondaryAttack()

end

function self:Deploy()
local owner = self:GetOwner
owner:SetRunSpeed(owner:GetRunSpeed() * 1000)
return true
end

function self:Holster()
local owner = self:GetOwner
owner:SetRunSpeed(owner:GetRunSpeed() / 1000)
return true
end`

timid cove
#

function self:Deploy() and self:Holster()
local owner = self:GetOwner

GetOwner needs parenthesis since its a function so do self:GetOwner()