Requested module experienced an error while loading (Fixed it dont mind)

Hi there I was making a script the code is below and on the 1st line the code gives the error specified in the title can someone help me to fix this, it wasn’t happening a few mins ago

local module = require(game.ServerStorage.SettingsForProfile)
game.Players.PlayerAdded:Connect(function(player)
	wait(1)
	
	if module.CashOnOff == "On" then

	elseif module.CashOnOff == "Off" then	
		game.ReplicatedStorage.RemoteForOnOffCash:FireAllClients()
		print("Fired")
	end





end)

Please help it isn’t working

What’s in the module script?

It’ll be coming from the module script.

Don’t store modules in ServerStorage. Store them in ServerScriptService or ReplicatedStorage.

but I had always put it in serverstorage but i’ll put it in serverscriptservice now

It still shows the error rn tho

Did you change the path to the Module?

local settingsModule = require(game.ServerScriptService.SettingsForProfile)

yes i did it and still it doesn’t work so I changed it back to server storage also the module script being in serverstorage is fine

Can you show the ModuleScript code?

local module = {}

module.theme = "Black"  -- Its either black or white
module.CashOnOff = "On"  --Its either On or Off keep capitalization correct
module.LeaderStatsPathForCash = game.Players.LocalPlayer.leaderstats.Cash -- Default for example change it
return module

local module = require(game.ServerStorage.SettingsForProfile)
game.Players.PlayerAdded:Connect(function(player)
	wait(1)
	
	if module.CashOnOff == "On" then

	elseif module.CashOnOff == "Off" then	
		game.ReplicatedStorage.RemoteForOnOffCash:FireAllClients()
		print("Fired")
	end





end)

Is the above code a LocalScript or Script?

its a script placed in serverscriptservice

There’s your problem. LocalPlayer can only be called on the client.

No I am using the player from player added then firing a remote event…

If this is fixed please post how you fixed it and then mark that as the Solution at the bottom of the post so that if anyone searches the devforum for answers your post can help them.

I did it myself you cant put a path to a thing