local distance = (position - tool.Muzzle.CFrame.p).magnitude local rayPart = Instance.new("Part", tool) rayPart.Name = "RayPart" rayPart.BrickColor = BrickColor.new(194) rayPart.Transparency = 0 rayPart.Anchored = true rayPart.CanCollide = false rayPart.TopSurface = Enum.SurfaceType.Smooth rayPart.BottomSurface = Enum.SurfaceType.Smooth rayPart.formFactor = Enum.FormFactor.Custom rayPart.Size = Vector3.new(2, 5, 2) rayPart.CFrame = CFrame.new(position, tool.Muzzle.CFrame.p) * CFrame.new(0, 0, 1) * convertToCFrameDegrees(90, 0, 0) local rayMesh = Instance.new("CylinderMesh",rayPart) rayMesh.Scale = Vector3.new(1,1,1) rayMesh.Offset = Vector3.new(0, -distance + rayMesh.Scale.y/2, 0) -- rayMesh.Scale = Vector3.new(1,distance,1) -- rayMesh.Offset = Vector3.new(0, -distance/2, 0)
We could use the Instance.new function to create the said object inside of rayPart.
Instance.new('Fire',rayPart);
This should create the Fire class inside the second argument of Instance.new, which is it's parent.
Hope this helped.
raypart.Instance.new("Fire")
put this at the end of ur script and i think it should work