hey i have gmod lua code that adds postal 2 petition to the game and it gives me error…
- User
hey i have gmod lua code that adds postal 2 petition to the game and it gives me error when im in first person view heres the error "[rupostalpetition] addons/rupostalpetition/lua/weapons/weapon_postalpetition/shared.lua:104: bad argument #1 to 'GetBonePosition' (number expected, got no value) 1. GetBonePosition - [C]:-1 2. unknown - addons/rupostalpetition/lua/weapons/weapon_postalpetition/shared.lua:104" and heres the code ``` local PetitionSound = {}
SWEP.PrintName = "Petition"
SWEP.DrawCrosshair = true
SWEP.Author = "" SWEP.Contact = "" SWEP.Purpose = "" SWEP.Instructions = "" SWEP.Category = "Postal 2"
SWEP.Slot = 1 SWEP.SlotPos = 0
SWEP.Spawnable = true SWEP.AdminSpawnable = true
SWEP.ViewModel = Model("models/postal/c_petition.mdl") SWEP.UseHands = true SWEP.WorldModel = "models/postal 2/weapons/clipboard.mdl" SWEP.SetHoldType = slam
SWEP.Primary.Clipsize = -1 SWEP.Primary.DefaultClip = -1 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "none"
SWEP.Secondary.Clipsize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none"
local PetitionSound = { Sound("petition/petition_1.wav"), Sound("petition/petition_2.wav"), Sound("petition/petition_3.wav"), Sound("petition/petition_4.wav"), Sound("petition/petition_5.wav"), Sound("petition/petition_6.wav"), }
function SWEP:Initialize() self:SetHoldType( "pistol" )
codeif SERVER then return end self.clipboard = ClientsideModel( self.WorldModel ) self.clipboard:SetNoDraw( true )end
function SWEP:Think() end
function SWEP:Reload()
end
function SWEP:Deploy() self.Owner:SetAnimation( PLAYER_IDLE ); self.Weapon:SendWeaponAnim( ACT_VM_IDLE ); end
function SWEP:PrimaryAttack() self.Owner:SetAnimation( PLAYER_IDLE ); self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ); local PetitionSoundFunc = table.Random(PetitionSound) self:EmitSound(PetitionSoundFunc) end
function SWEP:SecondaryAttack()
self.Owner:SetAnimation( PLAYER_ATTACK1 ); self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK ); self:EmitSound("petition/petition_sign.wav") end
function SWEP:OnRemove() self:SetHoldType( "pistol" )
codeif SERVER then return end if ( self.clipboard and self.clipboard:IsValid() ) then self.clipboard:Remove() endend
function SWEP:PreDrawViewModel( vm, wep, ply ) render.SetBlend( 0 ) end
- Assistant
- User
i have the same error, the issue is not in the bones, because when i had no world model everything worked fine
- Assistant