You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I have a shopgui and when a player buys an item I want to find the amount of money is required to buy it by checking how much it’s worth in a module script.
-
What is the issue? Include screenshots / videos if possible!
This is the localscript:
local module = require(script.Parent.ItemCost)
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.SelectedGear.Value ~= "" then
local cost = module[table.find(module, script.Parent.SelectedGear.Value)]
print(cost)
end
end)
module script:
local cost = {
["Sword"] = 150;
["LaserGun"] = 500;
["Jump"] = 750;
["2xSpeed"] = 1000
}
return cost
It prints out nil tho in the localscript.
Is there any other way of finding something in a module script?
I can’t really find anything about this.