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

The npc doesn't move to the place it's supposed to move via script, what to do?

Asked by 2 years ago

Hello, i've made this script that when a part is touched a npc is supposed to go to a different part but when i launch the game and touch the part the npc just stands still, it's not anchored, it has the animate script that gives him animations The script:

local Activator = script.Parent --the part that when touched moves the npc
local NPC = workspace.tynnnnngghn.Humanoid --the npc that will move
local Point = workspace.Checkpoint --the place the npc will go to

Activator:Connect(function(hit) --Activator (the part) when touched is supposed to activate the thing below
    NPC:MoveTo(Point) --npc(humanoid of the npc) should move to the point
    end

1 answer

Log in to vote
0
Answered by 2 years ago

local Activator = script.Parent local NPC = workspace.tynnnnngghn.Humanoid local Point = workspace.Checkpoint Activator.Touched:Connect(function(hit) NPC:MoveTo(Point) end)

Should work, you forgot the .Touched

0
Sorry for the late reply, the website wasn't really working for me. Now even with the .Touched, the npc still isn't moving famepek777 1 — 2y
Ad

Answer this question