How do I fix "Module code did not return exactly one value"

Hi I need help with this module script error, this is where I call the Modul Script:

game.Workspace.Dooor.Paart.ProximityPrompt.Triggered:Connect(function(player)
	require(workspace.NPCModuleScript)
end)

this is a normal script and its located in the ServerScriptService
and this is the Module:

local npc = game.Workspace.NPC

print("works")

npc:PivotTo(game.Workspace.NeighbourPart:GetPivot()) 

Note: it printed works, but the other stuff didn’t fire
the ModuleScript is located inside the workspace.

any help is appreciated :slight_smile:

Replace the code with this

local Module = {}
local npc = game.Workspace.NPC

print("works")

npc:PivotTo(game.Workspace.NeighbourPart:GetPivot()) 
return Module
2 Likes

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