how do i fix this? i tried setting the network owner but its still not working
script:
Dumy.HumanoidRootPart:SetNetworkOwner(nil)
MoveToScript:
local PartsFolder = script.Parent.Waypoints
while wait() do
script.Parent.Dummy.Humanoid:MoveTo(PartsFolder:GetChildren()[math.random(1, #PartsFolder:GetChildren())].Position)
script.Parent.Dummy.Humanoid.MoveToFinished:Wait()
end
local model = script.Parent
local waypoints = model:FindFirstChild("Waypoints"):GetChildren()
local char = model:FindFirstChild("Dummy")
local hum = char:FindFirstChildWhichIsA("Humanoid")
local function SetNetworkOwnership()
for i,v in ipairs(char:GetDescendants()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(nil)
end
end
end
local function GoToRandom()
local random = waypoints[math.random(1,#waypoints)]
hum:MoveTo(random.Position)
hum.MoveToFinished:Wait()
end
SetNetworkOwnership()
while true do
GoToRandom()
task.wait(.05)
end