well, when i go into game, I get this error "
weapons/weapon_adminweapon/shared.lua:95: ‘end’ expected (to close ‘function’ at line 53) near ‘<eof>’
"
This is my code, but can’t see what’s wrong wit line 53
[lua]
local ShootSound = Sound(
“weapons/crossbow/fire1.wav” )
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
SWEP.HoldType
= “smg”
end
if ( CLIENT ) then
SWEP.PrintName
= “The Admin Weapon”
SWEP.Author
= "b4nny:code TacoNinja1995:Edit"
SWEP.Slot
= 3
SWEP.SlotPos
= 2
SWEP.Contact
= “”
SWEP.Purpose
= “Killing”
SWEP.Instructions =
“Left Click:Shoot balls”
end
function SWEP:LaunchPill( )
if (!SERVER) then return end
local RandAngles = Angle
(math.random(0,360),math.random
(0,360),math.random(0,360))
local ply = self.Owner
local pill = ents.Create
(“models/props_junk/sawblade001a.mdl”)
pill:SetPos
(ply:GetShootPos())
pill:SetAngles(
RandAngles )
pill:Spawn()
pill:Fire(“Kill”, “”, 120)
local bPhys = pill:GetPhysicsObject()
local Force = ply:GetAimVector() *
10000
bPhys:ApplyForceCenter(Force)
self.Weapon:SetNextPrimaryFire
(CurTime() + self.Primary.Delay)
end
function SWEP:PrimaryAttack( )
self:LaunchPill()
self.Weapon:EmitSound(
ShootSound, 75, 110 )
self.BaseClass.ShootEffects( self )
end
function SWEP:ReportNumPills()
local numpills = #ents.FindByClass
(“models/props_junk/sawblade001a.mdl”)
if numpills < 1 then return end
if numpills > 1 then plPill = " Blades "
else plPill = " pill. "
end
Msg("Removed " … numpills … plPill )
end
function SWEP:DeletePills()
if (!SERVER) then return end
util.PrecacheSound(
“ambient/energy/spark1.wav” )
for k,v in pairs(ents.FindByClass
(“models/props_junk/sawblade001a.mdl”)) do
v:Remove()
v:EmitSound(
“ambient/energy/spark1.wav”, 70, 100 )
end
function SWEP:SecondaryAttack( )
self:DeletePills()
self:ReportNumPills()
end
SWEP.Spawnable =
false
SWEP.AdminSpawnable =
true
SWEP.ViewModel =
“models/weapons/v_smg1.mdl”
SWEP.WorldModel =
“models/weapons/w_smg1.mdl”
SWEP.Weight
= 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom =
false
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage
= 40
SWEP.Primary.NumShots =1
SWEP.Primary.Cone = 0
SWEP.Primary.ClipSize = -1
SWEP.Primary.Delay =
0.12
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.Delay = 1.0
SWEP.Secondary.Ammo
= “none”
–Thanks Fatal Muffin (well, thats what the original code said, but I really thought it was TheGreatVax who made it) for making the Ak47 that
shoots babies.
–I just modded his code a little bit and made
this.
[/lua]
help is appreciated, and that goes without saying.