Ive been working on a tower defense game and im tryna add a gamepass feature for the shop. Im trying to use a boolvalue for the true and false reason of it obviously but for some reason it never shows up in the shop. Been stuck with it the last few days.
Script where the bool value is created
Players.PlayerAdded:Connect(function(player)
local Even = Instance.new("BoolValue")
Even.Name = "Even"
Even.Value = false
Even.Parent = player
end
Heres the shop module script
local TowerShop = {
["Blue Robloxian"] = {
["Name"] = "Blue Robloxian",
["ImageAsset"] = "rbxassetid://11624666096" ,
["Price"] = 1 ,
["Description"] = " ",
["Event"] = --True if player owns gamepass if not false
}
return TowerShop
The function where the shop loads
function updateItems()
points.Text = "Points : " .. playerData.Points
limit.Text = #playerData.SelectedTowers .. "/4"
for i, tower in pairs(towers) do
local oldButton = gui.Frame.Center1.List:FindFirstChild(tower.Name)
if oldButton then
oldButton:Destroy()
end
local newButton = itemsFrame:Clone()
newButton.Name = tower.Name
newButton.TowerName.Text = tower.Name
newButton.Price.Text = tower.Price .. " Points"
newButton.Image.Image = tower.ImageAsset
newButton.Desc.Text = tower.Description
newButton.Visible = tower.Event
newButton.LayoutOrder = tower.Price
newButton.Parent = gui.Frame.Center1.List
local status = getItemStatus(tower.Name)
if status == "For Sale" then
newButton.Status.Text = "PURCHASE"
elseif status == "Equipped" then
newButton.Status.Text = "EQUIPPED"
newButton.Price.Visible = false
else
newButton.Status.Text = "EQUIP"
newButton.Price.Visible = false
end
newButton.Status.Activated:Connect(function()
interactItem(tower.Name)
end)
end
end