i want the script to be able to access the module script in order to gain data for the enemy, but it says the error in the title in relation to line 7
i can explain more if necessary
oh, and, the “enemie” is because i wasnt sure if the calling line was the issue, so i duplicated it and changed it to not be called upon (the one spelled correctly is the one CURRENTLY being used, but both have been tried)
Make sure you have correctly set up the new() function on your module correctly.
It should look something like this:
ModuleScript:
local enemies = {}
enemies.new = function(enemyName:string)
print("Creating a new enemy named "..enemyName)
end
return enemies
Defining(enemyName:string) enemyName as a string wasn’t necessary but it makes your scripting experience easier when you are using a lot of unknown variables like this:
Server or LocalScript:
local enemies = require(game.ReplicatedStorage.FirstEnemy)
enemies.new("Builderman") --Prints; Creating a new enemy named Builderman
Also an irrevelant tip; you can store your ModuleScripts inside of ServerStorage or ReplicatedStorage for better organization as they are designed for that.
Store them in ServerStorage if you don’t want the client to access that ModuleScript, store them in ReplicatedStorage if you want both the server and the client to see it.