STEAM GROUP
VrejGaming |Vrej|
STEAM GROUP
VrejGaming |Vrej|
226
IN-GAME
1,451
ONLINE
Founded
May 8, 2012
Language
English
Location
Armenia 
This topic has been locked
How to give SNPCs random bodygroups and skins?
I'm coding some SNPC's on VjBase. I was wondering how does one add the ability for the SNPC's to have random bodygroups on spawn?
Originally posted by DrVrej:
It's the same as any other entities in Garry's Mod, you use the SetSkin and bodygroup functions
< >
Showing 1-6 of 6 comments
A moderator of this forum has indicated that this post answers the original topic.
DrVrej Feb 22, 2017 @ 11:52am 
It's the same as any other entities in Garry's Mod, you use the SetSkin and bodygroup functions
thunderslug106 Feb 23, 2017 @ 6:33am 
I tried this: Entity:SetBodygroup(1,math.random(0,1))
but it comes up with
[ERROR] lua/entities/npc_vj_marineh3_female/init.lua:4: attempt to index global 'Entity' (a function value)
1. unknown - lua/entities/npc_vj_marineh3_female/init.lua:4

How do I fix this?
DrVrej Feb 23, 2017 @ 9:35am 
Originally posted by ❃thunderslug106❃:
I tried this: Entity:SetBodygroup(1,math.random(0,1))
but it comes up with
[ERROR] lua/entities/npc_vj_marineh3_female/init.lua:4: attempt to index global 'Entity' (a function value)
1. unknown - lua/entities/npc_vj_marineh3_female/init.lua:4

How do I fix this?
Why is "Entity" there?? Bro you need to know how programming works before you start making addons... I am saying this because the question you just asked proves you aren't aware of how methods or functions work... So I highly suggest you at least learn the basics of Lua before making addons. There are many tutorials out there that teach you the basics, there are even some that are focused on Garry's Mod Lua.
thunderslug106 Feb 23, 2017 @ 9:46am 
Yeah, I have made SWEPs on TFA base, but this is my first SNPC. I will look up some tutorials.
thunderslug106 Feb 26, 2017 @ 4:33am 
Good news! I have figured it out and I have allowed it to be a medic depending on the skin!
< >
Showing 1-6 of 6 comments
Per page: 1530 50