Making a flag move with players back.

[lua]local BoneIndx = ent:LookupBone(“ValveBiped.Bip01_Spine”)
local BonePos , BoneAng = ent:GetBonePosition( BoneIndx )
local flag = ents.Create(“prop_dynamic”)
flag:SetModel(“models/props_c17/GasPipes006a.mdl”)
flag:SetPos(BonePos)
flag:Spawn()
flag:Activate()
//constraint.Weld(ent,flag,BoneIndx,0,0,true)
flag:SetNotSolid(true)
flag:SetColor(team.GetColor(teamNum))[/lua]

This is ran serverside when the flag is picked up. I have tried parenting and weld with no luck. Anyone able to point me in the right direction as i don’t want to use think and setpos cause it gets choppy.

[lua]hook.Add(“Think”,“FlagMovement”,function()
flag:SetPos(–[[put the owner pos here with an offset]]–)
end)[/lua]

The problem with this is it is very choppy. I used the same method they used for making hats and its client side rather then server side.

You could try taking a look at the OCRP or cider gamemode to see how they do it.

Is that any help?

Use a ClientsideModel and move it in the PostPlayerDraw hook

Was going to suggest parenting it to the player, but someone beat me to it.

Or you could stop posting when you have no idea what your talking about

ma automerg

Well apart from hes said that parenting it to a player does not work.

Why don’t you try Entity:SetAttachment(ID) then make the player it’s parent?

If memory serves me right, you don;t have to parent something once it’s bound to an attachment.