Bee disapeard out side of the map due to a too large CFrame

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    the bee does not move when i am standing still and maybe moves to me

  2. What is the issue? Include screenshots / videos if possible!
    he goes out side of the map

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    setting the CFrame to the rootpart

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

--bee script 
--game.ServerStorage.WayPoint
-- child of the bee model
local runservice = game:GetService("RunService")
function pfunction()
	runservice.Heartbeat:Wait()
	local owner = script.Parent.Owner.Value
	local waypoint = game.ServerStorage.WayPoint:Invoke(owner.Character.Humanoid.RootPart.Position)
	local model = script.Parent
	local cframe = model:GetPivot()
	runservice.Stepped:Wait()
	--model:PivotTo(CFrame.new(model:GetPivot().Position,waypoint.Position))
	if waypoint.Position == cframe.Position then
		model:PivotTo(owner.Character.Humanoid.RootPart.CFrame)
	else
		for i = 0,1,0.1 do
			runservice.Stepped:Wait()
			local theCFrame = cframe:Lerp(waypoint.CFrame,i).Position
			model:PivotTo(CFrame.lookAt(theCFrame,waypoint.Position))
		end
		model:PivotTo(CFrame.lookAt(waypoint.Position,owner.Character.Humanoid.RootPart.Position))
	end
	local lastknownCFrame = waypoint.CFrame
	waypoint:Destroy()
	return lastknownCFrame
end
while script.Parent.Owner.Value.Parent do
	task.wait()
	local success,lastknownCFrame = pcall(pfunction,script.lastknownCFrame.Value)
	if success then
		script.lastknownCFrame.Value = lastknownCFrame
	else
		print(lastknownCFrame)
	end
	
end
script.Parent:Destroy()
--ServerScriptService
game.ServerStorage.WayPoint.OnInvoke = function(pos)
	local beeWaypoint = Instance.new("Part")
	beeWaypoint.Position = pos
	beeWaypoint.Shape = Enum.PartType.Ball
	beeWaypoint.Size = Vector3.new(1,1,1) * 1
	beeWaypoint.Anchored = true
	beeWaypoint.Transparency = 0.7
	beeWaypoint.CanCollide = false
	beeWaypoint.Parent = workspace
	beeWaypoint.Name = 'beeWaypoint'.. script.WaypointCount.Value
	game:GetService("Debris"):AddItem(beeWaypoint,7)
	script.WaypointCount.Value += 1
	return beeWaypoint
end
function spawnbee(player)
	local bee = game.ServerStorage.Bee:Clone()
	bee.Owner.Value = player
	bee.Parent = workspace
end
game.Players.PlayerAdded:Connect(spawnbee)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Could you check if your while loop is working. If it is not then change it to
while game.Players[script.Parent.Owner.Value] do

it work but it does not look intrested in me (i mean it does not lookat me)

Ok so it follows you but it don’t looks a you. Could you check if the parts to rotate the bee work?

i used my edited script when i used the devforum script + yours
i get this
Workspace.Bee.BeeScript:27: invalid argument #2 (string expected, got Instance) - Server - BeeScript:27
13:42:03.653 Stack Begin - Studio
13:42:03.653 Script ‘Workspace.Bee.BeeScript’, Line 27 - Studio - BeeScript:27
13:42:03.654 Stack End - Studio

If the original loop worked then use the original version. But check if the parts in the code to rotate the bee are running.