Need help with end

how do i end this script?
this is one of those times that i have a end breakdown and cant figure out how to end a script.

local delay = 1.5
local enemy = script.Parent.Parent.foipboss
local humanoid = enemy.Humanoid
local entryPOINT = script.Parent.Parent.position1
local entryPOINT2 = script.Parent.Parent.position2
local entryPOINT3 = script.Parent.Parent.position3
local entryPOINT4 = script.Parent.Parent.position4
local entryPOINT5 = script.Parent.Parent.position5
local entryPOINT6 = script.Parent.Parent.position6
local entryPOINT7 = script.Parent.Parent.position7
local entryPOINT8 = script.Parent.Parent.position8
local entryPOINT9 = script.Parent.Parent.position9
valuefunny = script.FunValue
valuefunny.Value  = math.random(1, 9)
nextmovement = script.FunValue.Value
if nextmovement == 1 then
	nextDestinationObject = entryPOINT	
elseif nextmovement == 2 then
	nextDestinationObject = entryPOINT2
elseif nextmovement == 3 then
	nextDestinationObject = entryPOINT3
elseif nextmovement == 4 then
	nextDestinationObject = entryPOINT4
elseif nextmovement == 5 then
	nextDestinationObject = entryPOINT5
elseif nextmovement == 6 then
	nextDestinationObject = entryPOINT6
elseif nextmovement == 7 then
	nextDestinationObject = entryPOINT7
elseif nextmovement == 8 then
	nextDestinationObject = entryPOINT8
elseif nextmovement == 9 then
	nextDestinationObject = entryPOINT9
end
local nextDestinationObject = entryPOINT
while task.wait(delay) do
	humanoid:MoveTo(nextDestinationObject.PrimaryPart.Position)
	humanoid.MoveToFinished:Wait()
	if nextDestinationObject == entryPOINT then
		valuefunny.Value  = math.random(1, 9)
		elseif
		if nextDestinationObject == entryPOINT2 then
		valuefunny.Value  == math.random(1, 9)
		else
			if nextDestinationObject == entryPOINT3 then
			valuefunny.Value  == math.random(1, 9)
			else
				if nextDestinationObject == entryPOINT4 then
				valuefunny.Value  == math.random(1, 9)
				else
					if nextDestinationObject == entryPOINT5 then
					valuefunny.Value  == math.random(1, 9)
					else
						if nextDestinationObject == entryPOINT6 then
						valuefunny.Value  == math.random(1, 9)
						else
							if nextDestinationObject == entryPOINT7 then
							valuefunny.Value  == math.random(1, 9)
							else
								if nextDestinationObject == entryPOINT8 then
								valuefunny.Value  == math.random(1, 9)
								else
									if nextDestinationObject == entryPOINT9 then
		                           valuefunny.Value  == math.random(1, 9)

i mean can’t you simply use pathfinding service instead for the shorter coding of positions

right now thats not really the point, your kinda correct but im trying to make it so the boss like jumps up and like stomps certain points.

what do you mean as in jumps up and stomp certain points

well not 100% sure, still an early version of the boss

how do you expect help if you dont know what you want :sob:

i was asking for help on the ends though, not the actual boss

well its the helpers’ job to understand what the author in help is aiming for with necessary standpoints to maintain the efficiency of the creation so since i am unknown of what you are trying to do and that you’ve only vaguely stated in terms of the NPC “jumping and stomping” it’s not very clear for me

the use of repetitive elseifs can be more time taking than rather creating a systematic function to do the work