So basically im trying to make a user friendly settings module and make the function set a players cash to the starting cash amount inside of the function, startingcash in the module script. It should be a simple fix but im stupid so i need help!, Thanks
Module
local module = {}
function startingcash(player)
local startingcashamount = 10 -- Replace this number with starting cash amount!--
player.leaderstats.Cash.Value = startingcashamount
end
return module
ServerScript
game.Players.PlayerAdded:connect(function(plr)
local leader = Instance.new("Folder",plr)
leader.Name = "leaderstats"
local cash = Instance.new("NumberValue",leader)
cash.Name = "Cash"
gamesettings.startingcash(plr)
end)
Error Inside of Serverscript: "00:30:33.496 - Workspace.Plieax's Tycoon Kit.Main Scripts.leaderboard:13: attempt to call field 'startingcash' (a nil value)"

2 comments
Show the script where you define gamesettings. Did you use "require"?
Part of the script*