• Wieght LUA
    13 replies, posted
Hey! I was wondering... How do i alter weight of a prop? I want to make models/props/de_train/ACunit2.mdl lighter so i can pick it up with a grav gun. Please don't randomly ban me for posting in the right section again.
cunit model lol
[QUOTE=c-unit;26659202]cunit model lol[/QUOTE] Wut? :S
Weight tool?
[QUOTE=-TB-;26660178]Weight tool?[/QUOTE] Im using DarkRP. So i need to be able to make it perm
[b][url=http://wiki.garrysmod.com/?title=PhysObj.SetMass]PhysObj.SetMass [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] See the example in the page.
[QUOTE=Entoros;26660564][b][url=http://wiki.garrysmod.com/?title=PhysObj.SetMass]PhysObj.SetMass [img_thumb]http://wiki.garrysmod.com/favicon.ico[/img_thumb][/url][/b] See the example in the page.[/QUOTE] thats usefull.
[lua] for k,v in pairs(ent.GetAll()) do if !(v:GetModel == "models/props/de_train/ACunit2.mdl") then v:SetMass(1) end end [/lua] You set this to a timer and it would spam your server every so often and I don't recommend. You could also hook it to a console command so that when used it will alter the mass of the prop. Edit. Make sure this is Server-Side not Client-Side or it wont work.
Should use the hook PlayerSpawnProp instead of ent.GetAll()
[QUOTE=-TB-;26684251]Should use the hook PlayerSpawnProp instead of ent.GetAll()[/QUOTE] I didn't know how the prop was being spawned, thus I did not hook it to anything.
[QUOTE=zzaacckk;26687796]I didn't know how the prop was being spawned, thus I did not hook it to anything.[/QUOTE] Its a money printer in Dark RP, so its a entity. You press F4 then entities then money printer then its spawns and prints money.
[QUOTE=zzaacckk;26683232][lua] for k,v in pairs(ent.GetAll()) do if !(v:GetModel == "models/props/de_train/ACunit2.mdl") then v:SetMass(1) end end [/lua] You set this to a timer and it would spam your server every so often and I don't recommend. You could also hook it to a console command so that when used it will alter the mass of the prop. Edit. Make sure this is Server-Side not Client-Side or it wont work.[/QUOTE] right there your making evrything but that modle's weight to 1.
Sorry, you need to Log In to post a reply to this thread.