So, I made a Module script inside of a actual script(not local script.) I am trying to clone a folder with Values inside of it into an actual player through two different scripts. Module and Acutal Script?
Here's the code for the Module..
local Module = {}
function Module.CreateFolder()
local plr
local Folder = Instance.new("Folder", plr)
Folder.Name = "Folder"
Instance.new("IntValue", Folder).Name = "Tokens"
Instance.new("IntValue", Folder).Name = "Codes"
Instance.new("StringValue", Folder).Name = "Trade"
Instance.new("BoolValue", Folder).Name = "BetaTester"
Instance.new("BoolValue", Folder).Name = "Exploiter"
Instance.new("BoolValue", Folder).Name = "Loaded"
Instance.new("BoolValue", Folder).Name = "Accept"
Instance.new("BoolValue", Folder).Name = "AFK"
end
return Module
Here's the actual script..
local Folder = require(script.Folder)
game.Players.PlayerAdded:Connect(function(plr)
Folder.CreateFolder()
end)
I thought this would work because of me thinking that I can make my code as neat as possible, but it didn't put the folder into the player.
Question: How can I still keep the module script and access the function "plr" without the script doing things that I didn't want it to do?

1 comment
wiki has a good article on arguments and parameters https://www.robloxdev.com/articles/Arguments-and-Parameters