#my swep isnt appreaing in my spawn menu!
1 messages · Page 1 of 1 (latest)
wy do Yoe define primaryattack Toow times?
oh i did
im just typing on a template
because i am that one patrick gif
are there any problems wuth the lua apart from that/
aand hes gone
Do you have the correct folder structure?
garrysmod/addons/mod/models,sound,lua etc
it must be like this garrysmod\addons\youraddonname\lua\weapons
for lua help like this you should ask #lua-help, not #994186967803768883 , you're more likely to get lua help in #lua-help
also the problem is that you forgot to put the function keyword when defining the SWEP:Reload() function
when you have a lua problem like this you should also check your console or problems menu for errors
because most of the time an error will appear there telling you where the issue in your code is
i wasnt at my computer
this is correct right?
done now thanks
yes, though the weapons folder is usually all lowercase, but im not sure if that matters
il fix that anyway
lets see if it works now :3
lowkey its not apearing ingame still
have you restarted gmod
you might need to
yes twin i did
does the problems menu say anything
you never fixed the Reload() syntax error i talked about
didnt save the lua lol
o lol
like this right?
ok so its working but if you ignore the big ass of my pm, you may knotice the BLYATTTTTT sign
i can fix it easy
ok now it fixed but not rlly
camera between loona thighs!11!11!
which isnt good
i should be there, not the thighs
also the hands should be as if its holding the camera item
not the pistol
also it seems to have a very high fire rate
also lowkey whenever i try to take a picture of my family they get mowed down by bullets 🙁
lol
yeah cuz the code makes it fire faster the longer it fires or something
hmmm il look at the lua
idk
if u didnt know im trying to make a camera
not a gun
that acts the same as the camera item
What the actual fuck
nah nah if you just ignore the thighs
lowkey
am i being stupid again
uhgh 🙁
yo man is it ok if u can help me more
?
i cant get the sound to play
also its not taking pictures, its lowkey swiss cheesing eveyrthing in its sight
also em this
try removing the "sound/" prefix from the path
like this?
my camera gun whatever it it at this stage is rlly quiet like fahhhh as if the sound isnt loading still
so is it not playing or is it really quiet
its not playing
is there anything in console when it tries to play
il check again
no errors
no lua errors
genuinely idk what im doing wrong vro
try entering play camerasfx/MavicaTakerPicture.mp3 in console
oh mh god
and see if that plays it
I SPELT IT WRONG
oh
nah im so stupid bro sorry

if that was the problem ima go crazy
it was
thx for making me realise
could you look in the lua and look at what controlls the trype of projectile and the fire rate?
i just want 1 click = 1 picture not 1 clock = 10 round burst of 9mm
you control what happens when you left click with the PrimaryAttack function
it fires bullets because of the FireBullets function being used in there
what do i need to change?
remove the code that fires bullets and replace it with code that takes a picture
what do i uhh type
sorry for being rlly annoinggg
you have been alot of help so far
as in like the camera swep?
yes twin
i got chatgpt to help me out lowkey
it can take pictures now
but lowkey uhh the camera model is between the pms legs
an also it looks like the pm is holding a pistol, not a camera
lowkey all these ppl saying 1 thing and the dissapearing making me bug out
its inside him
r u gonna help or r u just gonna say "wow this guy is shit at coding
" and leave
.
looks like you got the weapon swep working tho
yessss
yea its because of your lua code
yea but it seems to be defaulting to pistol hold type
yea
Check the rest of your code if you dont change that somewhere
like on picture taken
or smthing like that
wanna look at my lua?
Why are you doing SWEP.HoldType = "camera"?
when you do that here basically : function SWEP:Initialize()
self:SetHoldType("camera")
end
testing it now
uhhh
But i think the main issue is with the model
its not apearing in my game anymore
thats weird but the main issue is with the model because if you use: models/maxofs2d/camera.mdl
it looks as it should
by that i mean it appears in his hands
your code makes the lua just not apear ingame
should it be v_camera.mdl instead?
viewmodel etc
Usually yeah for example the smg looks like this in the lua code: SWEP.ViewModel = Model( "models/weapons/c_smg1.mdl" )
SWEP.WorldModel = Model( "models/weapons/w_smg1.mdl" ) but the camera is a w_model just not named like so
do i need to rename all of these with a w_ at the beggining or do i need to do only the .mdl file
do i?
this good?
Well you can try but im quite sure that wont work
well what do i need to do?
how did you make the model?
because the mistake was made in the making of the model
there is no issue with the code
that would like cause this
ok so whats the issue
cuz lowkey im tweaking
i didd everything fine. it appears ingame as a phys prop
Yea because it doesnt affect the model if its a prop
but since you are trying to put it into players hand
like an swep
the origin is deadass in the center
of everything
leme boot up blender
then the issue is in compiling
Might want to ask in modelling if that doesnt solve it / you cant find the issue
ok 🙂
the center
actaully could you take a better picture of this?
like where the camera is
Did you manage to fix the SetHoldType?
because with this code it seems to be working for me
no
the code u send me broke the lua
and it didnt apear ingame
try throwing the lua code into here: Steam\steamapps\common\GarrysMod\garrysmod\lua\weapons
ight i will...#
it can be named anything
kk
so?
yea and now try to put in your model
ight
SWEP.ViewModel = "models/maxofs2d/camera.mdl"
SWEP.WorldModel = "models/maxofs2d/camera.mdl"
replace here
kk
PROGRESS
okay the next issue could be this: function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if IsValid(owner) then
local bone = owner:LookupBone("ValveBiped.Bip01_R_Hand")
if not bone then return end
local pos, ang = owner:GetBonePosition(bone)
-- BEGIN CAMERA-LIKE OFFSETS (tuned for handheld cameras)
ang:RotateAroundAxis(ang:Right(), 90) -- rotate to face forward
ang:RotateAroundAxis(ang:Up(), 10) -- small correction
ang:RotateAroundAxis(ang:Forward(), 180) -- upside-down fix
pos = pos + ang:Forward() * 4
pos = pos + ang:Right() * 1.5
pos = pos + ang:Up() * -2
-- END OFFSETS
self:SetRenderOrigin(pos)
self:SetRenderAngles(ang)
self:DrawModel()
else
self:DrawModel()
end
end
try removing that and see what it does
ight
its back in the stomach
okay then keep that and modify the values
in the code
until you get desired effect
i guess
ight
can i not do it in real time
not aware of a way
or do i have to edit lua - reopen game and wait foir it to load, test it and its not right- repeat
il aslk in dev general
oh rlly?
yea
i was just reopening it
you can just type retry into console