Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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


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

1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.