--[[
Varibles
]]
local NPC = workspace:WaitForChild("Leader")
local NPCPosFolder = workspace:WaitForChild("NPCPositions")
local CurrentPos = 1
local NextPos = NPCPosFolder["Pos"..CurrentPos].Position
local Repstorage = game:GetService("ReplicatedStorage")
local Status = Repstorage:WaitForChild("Status")
--[[
StoryLine
]]
local Dialog = {
"Campleader : Heya fokes , Welcome to camp greenlake",
"If you follow me i'll show you around"
}
local function FirstPlayerLoaded()
end
--[[
function for letting a npc walk
]]
--[[
Main StoryLineScript
]]
local function PlayStoryLine()
Status.Value = Dialog[1]
wait(3)
Status.Value = Dialog[2]
for NpcWalk = 1,2 do
NPC.Humanoid:MoveTo(NextPos)
NPC.Humanoid.MoveToFinished:wait()
CurrentPos = CurrentPos + 1
print(CurrentPos)
end
end
PlayStoryLine()
So bassicly i have this for loop to make my script not so long and hard to manage but it adds current pos twice so it will end up being 3 and it does not move to the second location is has how do i fix this?

2 comments
Just a reminder- you can do just "--" instead of "--[[ ]]" to create a comment. Obnoxious comments can seem very bad on your code.
Why do you need the loop then? You can just remove it.