Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Humanoid:Move() Interrumpted by player being near?

Asked by 8 years ago
Edited 8 years ago

I simply run this on the npc. script.Parent.Humanoid:Move(Vector3.new(1,0,0),false) Which is fairly simple and works fine in play test, the npc moves in the specified direction.

But when in server mode, If a player is close to it (About 10 studs i'd say) It just stops moving. And resumes it's movement once the player is away.

I tried in different places, it works fine. So it is only in that specific place i am working on. In said place, i tried disabling all code, except the npc's, And it still does it.

Does anyone have any idea why? Thanks!

Also here's a gyazo of what it looks like.

https://i.gyazo.com/5a57b3c36ed5e7c02048b6e8b07c5a7e.mp4

0
I don't know why this wouldn't work, but you could try using the WalkToPoint property or the MoveTo method. Move would probably be better in this case, but you might want to check out the other two if you can't find a solution. Perci1 4988 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Do this: for i = 0,100,1 Humanoid:TranselateBy(Vector3.new(i,0,0)) wait() end

change the 3 numbers after i = to what ever you'd like.

Ad
Log in to vote
0
Answered by 3 years ago

This is due to the Roblox engine having automatic NetworkOwnership set to auto. NetworkOwnership is where the physics of the BaseParts are being handled. If you are using Humanoid:Move() on client you'd have to set the NetworkOwnership to the player on a server-sided script and disable SetNetworkOwnershipAuto like:

--server-side
game.ReplicatedStorage.SetOwner.OnServerEvent:Connect(function(plr)
    for i,v in pairs(workspace.HumanoidNPC:GetChildren()) do
        v:SetNetworkOwnershipAuto(false)
        v:SetNetworkOwner(plr)
    end
end)

and on the client you'd just have to fire the RemoteEvent you put somewhere.

If you are doing this via server-side you'd just have to disable auto ownership like such:

for i,v in pairs(workspace.HumanoidNPC:GetChildren()) do
    v:SetNetworkOwnershipAuto(false)
end

Answer this question