This is the module Script
function Shop.Sell(player)
local Ore = Shop.OreName
if player.OreMaterial[Ore].Value >= OreMod[Ore].price then
player.leaderstats.Money.Value = player.leaderstats.Money.Value * OreMod[Ore].price
player.OreMaterial[Ore].Value = 0
else
print("Nothing to sell")
end
end
I get an error: 15:47:35.845 - ServerScriptService.ShopModule:9: attempt to index field 'OreMaterial' (a nil value) if player.OreMaterial[Ore].Value >= OreMod[Ore].price then is the part I need fixed
This is inside the LocalScript
local player = game:GetService("Players")
function SellStone()
game.ReplicatedStorage.LevelUp:FireServer( "Stone")
end
script.Parent.SellStone.MouseButton1Click:Connect(SellStone)
and this is the script where I access my RemoteEvents
function SellOre(player, Ore)
ShopMod.OreName = Ore
ShopMod:Sell(player)
end

4 comments
Your Module script from line 5 to 6, I have a question. Why do you want to make the player's money value * Ore's price then replace player's money value become 0? I confused about this and took it was the error occured reason xD
Just ignore that part atm, I need help with the if player.OreMaterial[Ore].Value >= OreMod[Ore].price then
the player table does not have OreMaterial in it.
I Know, but it's fixed now.