My module script
local module = {
["DisplayProduct"] = {
["Name"] = "ADMIN",
["Image"] = 0,
["Price"] = "150,000",
["GamepassId"] = 0,
},
["testproduct"] = {
["Name"] = "Harry Potter",
["Image"] = 0,
["Price"] = "NOT FOR SALE",
["GamepassId"] = 0,
active = true
}
}
return module
My local script
if Gamepasses.testproduct.active == true then
local zz = GamepassFrame
zz.name.Text = Gamepasses.testproduct.Name
zz.ProductImage.Image = Gamepasses.testproduct.Image
zz.Purchase.price.Text = Gamepasses.testproduct.Price
zz.Parent = Container.Gamepasses
zz.ProductImage.MouseButton1Click:Connect(function()
MarketplaceService:PromptGamePassPurchase(player, Gamepasses.testproduct.GamepassId)
end)
end
I'm trying to detect if a table's value named "active" is true or false, if true it clones a frame and fills in the information using the table values, but I'm very unsure of how to create this.
Any help would be appreciated!
What I'm getting at here is you have the info of a gamepass/dproduct in a module script, and if active is true, then you clone a GUI?
If so, here's an answer I've come up with. This script assumes you have the Modulescript parented inside the localscript and is called
config. I haven't tried it yet though:I hope this works, just tell me if it doesn't and I'd be happy to help!