Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- for k,v in pairs(player.GetAll()) do SafeRemoveEntity(v.arm_mdl) end
- hook.Add("PostDrawViewModel", "viewmodel_Test", function()
- local ply = LocalPlayer()
- local vm = ply:GetViewModel()
- if not IsValid(ply.arm_mdl) then
- local ent = ents.CreateClientProp()
- ent:SetModel(ply:GetModel())
- ent:SetParent(vm)
- ent:AddEffects(EF_BONEMERGE)
- ent:SetNoDraw(true)
- ply.arm_mdl = ent
- else
- local ent = ply.arm_mdl
- ent:DrawModel()
- for i = 1, ent:GetBoneCount() do
- local name = ent:GetBoneName(i)
- if name then
- name = name:lower()
- if name:find("head") then
- ent:ManipulateBoneScale(i, Vector(0,0,0))
- end
- end
- end
- end
- end)
- end
- if SERVER then
- hook.Add("Think", "viewmodel_test", function()
- for key, ply in pairs(player.GetAll()) do
- local vm = ply:GetViewModel()
- if vm:IsValid() then
- local mdl = vm:GetModel()
- mdl = mdl:gsub("v_", "c_")
- if vm:GetModel() ~= mdl then
- vm:SetModel(mdl)
- end
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment