Hey guys, I made a code that selects the head of a player, and I want to make the head bigger, but how to do it? Since the inflator can make things bigger, can I use that code? Or?
Heres my code:
[code]if !LocalPlayer():Alive() then
local ent=LocalPlayer():GetRagdollEntity()
local head=ent:GetPhysicsObjectNum(10)
head:
end[/code]
Thanks!
SetModelScale? Idk
It's somewhere on here, though it looks a little complicated.
[url]http://luabin.overvprojects.nl/?path=/gamemodes/sandbox/entities/weapons/gmod_tool/stools/inflator.lua[/url]
[QUOTE=_Undefined;24238919]It's somewhere on here, though it looks a little complicated.
[url]http://luabin.overvprojects.nl/?path=/gamemodes/sandbox/entities/weapons/gmod_tool/stools/inflator.lua[/url][/QUOTE]
It's this bit which actually lets you inflate the selected bone:
[lua] local function ScaleBone( Entity, Pos, Bone, Scale )
//local Bone, BonePos = Entity:FindNearestBone( Pos )
if ( !Bone ) then return false end
if ( SERVER ) then
// Change this specific bone's size
local VarName = "InflateSize"..Bone
local NewSize = Entity:GetNetworkedInt( VarName, 0 ) + Scale
NewSize = math.Clamp( NewSize, -100, 500 )
duplicator.StoreEntityModifier( Entity, "inflator", { [Bone] = NewSize } )
Entity:SetNetworkedInt( VarName, NewSize )
end
// Send an effect to let the player know which bone we're scaling
local effectdata = EffectData()
effectdata:SetOrigin( Pos )
util.Effect( "inflator_magic", effectdata )
end [/lua]
So to scale a bone using that, just do
[lua]ScaleBone( NameofEntity, Position, NameofBone, ScaleToInflate )[/lua]
Sorry, you need to Log In to post a reply to this thread.