Entity Bodygroups broken?

Hello, I am having trouble with setting bodygroups both CLIENT/SERVER realms, hoping you guys can help!

(is my game corrupted?)




	local trace = Player:GetEyeTrace()
	
	local bg = {{7, 0}, {8, 0}, {9, 0}, {10, 0}, {11, 4}, {12, 0}, {13, 0}, {14, 0}, {15, 0}, {18, 0}}
	
	for _, d in pairs(bg) do
		print(d[1], "->", d[2])
	end
	
	if IsValid(trace.Entity) and trace.Entity:IsVehicle() then
		for k,v in pairs(bg) do
			trace.Entity:SetBodyGroup(v[1], v[2])
		end
	end


Try moving that code to lua/autorun so it gets run for both client and server

Still doesn’t work after moving into shared realm.

even just doing :SetBodyGroup(1, 1) errors out.

Oh, I’m stupid… I didn’t notice the most obvious thing. The problem is this:

SetBodyGroup

It should be lowercase.

SetBodygroup

Thanks.

Dunno why notepad++ recognizes it as a mutator.