|
| 07 Nov 2014 02:14 PM |
id=185900980
Can anyone identify and fix the problem??
It moves and follows you if ur close enough, but for me, it didn't follow me. It just kept going in a streight line and fell off the baseplate. What the heck? ;_; |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 02:19 PM |
Im on my phone so I can't test it
Explain the problem better Like besides the fact if walks off the base
What do you mean server only What do you mean only if your close, it works if you are close? |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 02:22 PM |
local CurrentPart = nil local MaxInc = 14
function onTouched(hit) if hit.Parent == nil then return end
local humanoid = hit.Parent:findFirstChild("Monster")
if humanoid == nil then CurrentPart = hit end end
function waitForChild(parent, childName) local child = parent:findFirstChild(childName)
if child then return child end
while true do print(childName)
child = parent.ChildAdded:wait()
if child.Name==childName then return child end end end
local Figure = script.Parent local Humanoid = waitForChild(Figure, "Monster") local Torso = waitForChild(Figure, "Torso") local Left = waitForChild(Figure, "Left Leg") local Right = waitForChild(Figure, "Right Leg")
Humanoid.Jump = true
Left.Touched:connect(onTouched) Right.Touched:connect(onTouched)
while true do wait(math.random(2, 6))
if CurrentPart ~= nil then if script.Parent.Chasing.Value == false then
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart) end end end
This is the script that's causing the problem I believe. When he walks towards me, and then he moves randomly again (The chasing bool should have fixed this though :/) he sometimes gets glitched and moves in a streight line forever unless he randomly moves again. He also doesn't follow me while moving in the streight line. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 02:29 PM |
:MoveTo(Torso.Position
That should be currentPart.Position
Otherwise you are moving the the npcs current position + some random numbers |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 02:32 PM |
I changed that and this time he moved far far away. Not just little footsteps.
;-; |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 02:36 PM |
Did you move?
You never update the path so he just goes straight for you/where you were |
|
|
| Report Abuse |
|
|