How to prevent bullet holes from floating when target is moving

I made a bullet hole system for ACS and at the moment there are a few bugs such as the bullet holes floating when the target is moving. How can I fix this?



Evt.HitEffect.OnServerEvent:Connect(function(Player, Position, HitPart, Normal, Material, Settings)
	Evt.HitEffect:FireAllClients(Player, Position, HitPart, Normal, Material, Settings)

	local a ="Part", BulletModel)
	a.FormFactor = "Custom"
	a.TopSurface = 0
	a.BottomSurface = 0
	a.Transparency = 1
	a.CanCollide = false
	a.Size =, 0, 0.5)
	a.CFrame =,Position-Normal) * CFrame.Angles(90*math.pi/180,math.random(0,360)*math.pi/180,0)
	a.BrickColor ="Really black")
	a.Material = Enum.Material.Air
	a.Name = "BulletHole"
	a.Parent = HitPart

	local b ='WeldConstraint')
	b.Parent = a
	b.Part0 = a
	b.Part1 = HitPart

	local c ="Decal", a)
	c.Texture = "rbxassetid://"..default_bulletholes[math.random(1,5)]
	c.Face = "Top"
	c.Transparency = 0.1

	local d ="PointLight", a)
	d.Color =, 0, 0)
	d.Range = 0
	d.Shadows = true

	local e ="Weld")
	e.Part0 = a
	e.Part1 = HitPart

-- No end because below this point is irrelevant

Also if anyone has better bullet hole system that I could port to ACS that would be awesome.

The issue is that it uses the clients position value which changes between server and client.

Instead you should calculate the relative position from the hit part as the new origin that was obtained on the client using :ToObjectSpace and send that relative position vector instead.

A better way to visualize this to object space math is an attachment instance. Position this attachment on client, send over its CFrame and parent part to the server and use that to recreate it on the server.