Tower defense game not working

Enemies are not moving in my friend and I’s tower defense game.

I’ve tried solving this with many things, eventually I squashed as many bugs as possible and yet they still dont move. I have no errors in the output box.

Edit: The enemies are being moved using the MoveTo() function. It is a flat path and they’re just not moving at all. I added the game because copylock is off so I was thinking someone could copy the game and check the scripts. The mobs are in a folder in serverstorage. I have two scripts in serverscriptservice, a serverscript and inside a module script.
Here are the scripts:
ServerScript

local mob = require(script.Mob)
local map = workspace.RuinsMap

for i=1, 3 do
	mob.Spawn("Prisoner", map)
	task.wait(1)
end

ModuleScript

local ServerStorage = game:GetService("ServerStorage")
local mob = {ServerStorage.Mobs:GetChildren()}
local map = workspace.RuinsMap

function mob.Move(mob, map)
	local Humanoid = mob:WaitForChild("Humanoid")
	local waypoints = map.Waypoints

	for waypoint=1, #waypoints:GetChildren() do
		Humanoid:MoveTo(waypoints[waypoint].Position)
		Humanoid.MoveToFinished:Wait()
	end
end	
	function mob.Spawn(name, map)
			local mobExists = ServerStorage.Mobs:FindFirstChild(name)
	
	if mobExists then
		local newMob = mobExists:Clone()
		newMob.HumanoidRootPart.CFrame = map.Start.CFrame
		newMob.Parent = workspace
		
		mob.Move(newMob, map)
		print("m")
	else
		warn ("Requested mob does not exist", name)
	end
end
return mob




Here is the game:

You’ve got to provide us with so many more details. Most people won’t play a game posted here because that only tells us it isn’t working.

  • How are you moving the enemies? (CFraming, pathfinding, raycasts, custom method)
  • Are they NPCs or models?
  • Are they flat paths or up and down hills?
  • Are the enemies not moving at all, or just travelling a certain distance and stopping?

And since it’s the scripting support forum you HAVE to copy/paste your code here. Put 3 backticks (```) before and after your code so it formats properly here.

Bro what kind of question is this

I added more info, hope that helps

1 Like

How is this the solution You are just saying you added more info

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.