#need help fixing code in lua

1 messages · Page 1 of 1 (latest)

opaque temple
#

in terms of custom weapons, keep in mind that you won’t be able to use custom player animations without a third party addon such as wiltos

#

otherwise, weapons will always parent to the anim_attachment on the players right hand

last plaza
#

i know i am adding the model to a server i play on

opaque temple
#

or bonemerge idr

#

You what

#

Is this for PAC?

last plaza
#

i have most of the code but i need help fixing it to make it look how i want in in game

#

can you hop in general 2 vc

opaque temple
#

no, I’m on my phone at work.

last plaza
#

well i have the base code for it that i got from another addon and i am trying to recode it to work with my model and textures do you know how to help me with that

opaque temple
#

what addon are you basing it off of?

#

If you have a model that would mean you’ve setup the bones for it by now, yes?

last plaza
#

targeted explosion addon

opaque temple
#

I have no idea what that is

last plaza
#

it is just a addon of someon holding a small tablet in one hand

opaque temple
#

But anyways, it should be as simple as switching out SWEP.ViewModel with your new viewmodel

#

If the problem is with the model then that’s kinda on you; recompile it until it looks right

#

are the hands not appearing?

last plaza
#

i got that already but its the problem of the model not having the textures i added and it is not in the hand

opaque temple
#

…the tablet isn’t in your hand?

#

What does it look like in game? Can you share a screenshot?

last plaza
#

it is not in the hand it is flouting off to the side

#

i want it to look like this

#

but i got this

opaque temple
#

Assuming the hands placed correctly in Blender, your material probably has $noz applied to it or similar, so is trying to render on top of everything else. Post your .vmt script

last plaza
#

"VertexlitGeneric"
{
"$basetexture" "models/darken/tv_screen_capybara/tv_screen_capybara"
}

#

is that what you wanted

opaque temple
#

Ok, so something else is going on then.

#

Feel free to dump the addon folder into a .zip, and try sending it here. Someone else can take a look at it cause I have to go to work

last plaza
opaque temple
#

Oh, no, the screen is definitely in front of the hands.

#

Yeah....

#

Just keep saving over your file until you get a good position.

#

As for the material... Keep in mind, that's a material override, which overrides all materials on the model. Models can have multiple materials, not just 1

#

You probably wont be able to set submaterials with the weapon base you're using

#

...Ooop.

#

v.subMaterails exists (it's a table)

#
if (v.subMaterails) then
    for k,v in pairs(v.subMaterials) do
        model:SetSubMaterial(k - 1, v)
    end
end 
#

...wait

#

Fucking.

#

Okay, set subMaterails=true and subMaterials = {"your/material", "the/other/material"} in your VElements table

#

The author of the base misspelled Materials in the first if condition