Hello! I need the script to retrieve from the module only values that are “Class = and here is the name of some store”
That is, if, for example, I need values for a regular store, it should only get [1,2,3] from the module
--Module
local Items = {
[1] = {NameIt = "Money Per Click", Cost = 1, Info = "test1", Limit = 1000, Class = "BasicShop", PositionCFrame = CFrame.new(28.9639988, 1.69099998, 9.8030014, 0, 0, -1, 0, 1, 0, 1, 0, 0)},
[2] = {NameIt = "Cooldown", Cost = 1 , Info = "test2", Limit = 1000, Class = "BasicShop", PositionCFrame = CFrame.new(28.9639988, 1.69099998, 14.791, 0, 0, -1, 0, 1, 0, 1, 0, 0)},
[3] = {NameIt = "Test", Cost = 1, Info = "test3", Limit = 1000, Class = "BasicShop", PositionCFrame = CFrame.new(28.9639988, 1.69099998, 19.661, 0, 0, -1, 0, 1, 0, 1, 0, 0)},
}
return Items
--Local script
local Curret = script.Parent.Curret
local ShopForNow = script.Parent.ShopPicked
local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera
local InfoSc = script.Parent.InfoFrame.ScrollingFrame
local MoneyLib = require(RS:WaitForChild("Modules"):WaitForChild("MoneyLib"))
local Items = require(RS.Modules.Shops.Items)
ButtonL.MouseButton1Click:Connect(function()
if Curret.Value == 1 then
Camera.CameraType = Enum.CameraType.Scriptable
Curret.Value = math.max() --here i need to get these values
Camera.CFrame = Items[Curret.Value].PositionCFrame
InfoSc.Cost.Text = "Cost: $" ..MoneyLib.DealWithPoints(Items[Curret.Value].Cost)
InfoSc.Info.Text = Items[Curret.Value].Info
InfoSc.NameItem.Text = Items[Curret.Value].NameIt
else
Curret.Value -= 1
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Items[Curret.Value].PositionCFrame
InfoSc.Cost.Text = "Cost: $" ..MoneyLib.DealWithPoints(Items[Curret.Value].Cost)
InfoSc.Info.Text = Items[Curret.Value].Info
InfoSc.NameItem.Text = Items[Curret.Value].NameIt
end
end)
I do not know how to do that. Anyone have any ideas?
(I don’t know how to get all the values and search by [Class] only the values that are ShopForNow.Value)