This is my first thread, so I guess I'll give it a shot...
I own a DarkRP server and I wanted to take a weapon from the Homicide gamemode. I did (with the creator's permission), and for a while it worked on my server. The problem is, now the weapon doesn't spawn from the buy menu on my server and it doesn't show up on the Q menu. I don't remember changing anything, so I'm not sure what's going on.
Here's an error from the console:
[CODE][Batrachotoxin Needle] lua/weapons/wep_jack_hmcd_poisonneedle.lua:150: ')' expected near ':'
1. unknown - lua/weapons/wep_jack_hmcd_poisonneedle.lua:0[/CODE]
I checked said lua file and went to line 150. Here's the line there:
[CODE] function SWEP:DrawWorldModel()[/CODE]
Which is part of this block of code:
[CODE]if(CLIENT)then
function SWEP:GetViewModelPosition(pos,ang)
if not(self.DownAmt)then self.DownAmt=8 end
if(self.Owner:KeyDown(IN_SPEED))then
self.DownAmt=math.Clamp(self.DownAmt+.1,0,8)
else
self.DownAmt=math.Clamp(self.DownAmt-.1,0,8)
end
local NewPos=pos+ang:Forward()*30-ang:Up()*(12+self.DownAmt)+ang:Right()*10
return NewPos,ang
end
function SWEP:DrawWorldModel()
local Pos,Ang=self.Owner:GetBonePosition(self.Owner:LookupBone("ValveBiped.Bip01_R_Hand"))
if(self.DatWorldModel)then
if((Pos)and(Ang)and
function SWEP:DrawWorldModel()
self:DrawModel()
end //(GAMEMODE:ShouldDrawWeaponWorldModel(self)))then
self.DatWorldModel:SetRenderOrigin(Pos+Ang:Forward()*6-Ang:Up()*2+Ang:Right()*1)
Ang:RotateAroundAxis(Ang:Right(),-30)
self.DatWorldModel:SetRenderAngles(Ang)
self.DatWorldModel:DrawModel()
end
else
self.DatWorldModel=ClientsideModel("models/weapons/w_models/w_jyringe_proj.mdl")
self.DatWorldModel:SetPos(self:GetPos())
self.DatWorldModel:SetParent(self)
self.DatWorldModel:SetNoDraw(false)
self.DatWorldModel:SetModelScale(.5,0)
end
end
function SWEP:ViewModelDrawn()
--
end
end[/CODE]
If more info is needed I can supply it.
Why are you calling 'function SWEP:DrawWorldModel()' inside 'SWEP:DrawWorldModel()' ?
Also you're using an if statement (line 149) and never complete it with a then statement, but instead call a function inside of another function
[QUOTE=JasonMan34;48824518]Why are you calling 'function SWEP:DrawWorldModel()' inside 'SWEP:DrawWorldModel()' ?
Also you're using an if statement (line 149) and never complete it with a then statement, but instead call a function inside of another function[/QUOTE]
So what am I supposed to change here?
[QUOTE=OctaneWolf;48828563]So what am I supposed to change here?[/QUOTE]
......
I literally told you in my last post.
Don't call a function inside of itself, and complete your "if" statement
Sorry, you need to Log In to post a reply to this thread.